Rename func (#95639)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/95639
Approved by: https://github.com/ezyang
diff --git a/torch/_dynamo/guards.py b/torch/_dynamo/guards.py
index f36d5e8..0add0c1 100644
--- a/torch/_dynamo/guards.py
+++ b/torch/_dynamo/guards.py
@@ -36,7 +36,7 @@
np,
orig_code_map,
rename_implicit,
- tensor_shape_should_be_static,
+ tensor_always_has_static_shape,
tensor_static_reason_to_message,
tuple_iterator_getitem,
tuple_iterator_len,
@@ -501,7 +501,7 @@
# as an empty set is a safe degeneration - that is, a strictly static tensor is always valid for a frame
# compiled with that same
# tensor + more onerous user directives.
- static, reason = tensor_shape_should_be_static(
+ static, reason = tensor_always_has_static_shape(
value, guard.source, is_tensor=True
)
if not static:
diff --git a/torch/_dynamo/utils.py b/torch/_dynamo/utils.py
index 0fb798a..7e28b6b 100644
--- a/torch/_dynamo/utils.py
+++ b/torch/_dynamo/utils.py
@@ -1346,7 +1346,7 @@
raise AssertionError(f"Illegal reason {reason}")
-def tensor_shape_should_be_static(
+def tensor_always_has_static_shape(
tensor: Union[torch.Tensor, Any], source: Optional["Source"], is_tensor: bool
) -> Tuple[bool, TensorStaticReason]:
"""
diff --git a/torch/_dynamo/variables/builder.py b/torch/_dynamo/variables/builder.py
index 1bee600..173d5d4 100644
--- a/torch/_dynamo/variables/builder.py
+++ b/torch/_dynamo/variables/builder.py
@@ -47,7 +47,7 @@
np,
odict_values,
preserve_rng_state,
- tensor_shape_should_be_static,
+ tensor_always_has_static_shape,
tensor_static_reason_to_message,
tuple_iterator,
tuple_iterator_getitem,
@@ -1063,7 +1063,7 @@
if type(e) in (torch.Tensor, torch.nn.Parameter) or (
ignore_subclass and isinstance(e, torch.Tensor)
):
- static_shapes, reason = tensor_shape_should_be_static(e, source, is_tensor)
+ static_shapes, reason = tensor_always_has_static_shape(e, source, is_tensor)
fake_e = wrap_fake_exception(
lambda: tx.fake_mode.from_tensor(