Skip to content

Commit e2b8344

Browse files
committed
Merge branch 'main' into titaiwang/only_merge_shapes_in_identity_or_do_infer
2 parents 037040e + 32a61f4 commit e2b8344

File tree

9 files changed

+202
-120
lines changed

9 files changed

+202
-120
lines changed

onnxscript/function_libs/torch_lib/ops/common.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,24 @@
2828

2929
@onnxscript.script(common_opset)
3030
def Rank(input: tensor_typing.TTensor) -> INT64:
31-
"""Take the rank of the input tensor."""
31+
"""Deprecated.
32+
33+
NOTE: Do not remove, for backward compatibility with PyTorch < 2.10.
34+
35+
Take the rank of the input tensor.
36+
"""
3237

3338
return op.Size(op.Shape(input))
3439

3540

3641
@onnxscript.script(common_opset)
3742
def IsScalar(input: tensor_typing.TTensor) -> BOOL:
38-
"""Return whether the input has rank 0, or is a scalar."""
43+
"""Deprecated.
44+
45+
NOTE: Do not remove, for backward compatibility with PyTorch < 2.10.
46+
47+
Return whether the input has rank 0, or is a scalar.
48+
"""
3949

4050
return op.Equal(op.Size(op.Shape(input)), op.Constant(value_int=0))
4151

0 commit comments

Comments
 (0)