mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
dont bake in defaults when tracing *_like factories (#97564)
quick fix for https://github.com/pytorch/pytorch/issues/97541. letting CI run to see if there's any fallout Pull Request resolved: https://github.com/pytorch/pytorch/pull/97564 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
2ca911f2ac
commit
35c9ea89fa
@ -815,9 +815,7 @@ def signature_from_schema(
|
||||
type=OptionalType(BaseType(BaseTy.ScalarType)),
|
||||
default="None",
|
||||
default_init=(
|
||||
"self.scalar_type()"
|
||||
if is_like_or_new_function
|
||||
else topt_default_init("dtype")
|
||||
None if is_like_or_new_function else topt_default_init("dtype")
|
||||
),
|
||||
)
|
||||
)
|
||||
@ -827,9 +825,7 @@ def signature_from_schema(
|
||||
type=OptionalType(BaseType(BaseTy.Layout)),
|
||||
default="None",
|
||||
default_init=(
|
||||
"self.layout()"
|
||||
if is_like_or_new_function
|
||||
else topt_default_init("layout")
|
||||
None if is_like_or_new_function else topt_default_init("layout")
|
||||
),
|
||||
)
|
||||
)
|
||||
@ -839,7 +835,7 @@ def signature_from_schema(
|
||||
type=OptionalType(BaseType(BaseTy.Device)),
|
||||
default="None",
|
||||
default_init=(
|
||||
"self.device()"
|
||||
None
|
||||
if is_like_or_new_function
|
||||
else (
|
||||
topt_default_init("device")
|
||||
|
Reference in New Issue
Block a user