Skip to content

Commit c9ec08f

Browse files
angelayifacebook-github-bot
authored andcommitted
Change check to use torch.compiler.is_compiling()
Differential Revision: D82837368
1 parent eb21763 commit c9ec08f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchrec/sparse/jagged_tensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ def _jt_flatten_spec(t: JaggedTensor, spec: TreeSpec) -> List[Optional[torch.Ten
10661066
def _assert_tensor_has_no_elements_or_has_integers(
10671067
tensor: Optional[torch.Tensor], tensor_name: str
10681068
) -> None:
1069-
if is_torchdynamo_compiling() or tensor is None:
1069+
if torch.compiler.is_compiling() or tensor is None:
10701070
# Skipping the check tensor.numel() == 0 to not guard on pt2 symbolic shapes.
10711071
# TODO(ivankobzarev): Use guard_size_oblivious to pass tensor.numel() == 0 once it is torch scriptable.
10721072
return

0 commit comments

Comments
 (0)