1 r"""This file provides a location for operators that help exporting 2 models via onnx. E.g. shape_as_tensor and reshape_from_tensor_shape 3 are to make all dynamic sizes operations traceble. 5 NOTE: at one point these functions were implemented differently. 6 Since then we have implemented these directly in ATen, so this 7 file is kept purely for backward-compatibility. 15 def shape_as_tensor(x):
16 return torch._shape_as_tensor(x)
19 def reshape_from_tensor_shape(x, shape):
20 return torch._reshape_from_tensor(x, shape)