Files
pytorch/torch/onnx/operators.py
James Reed f380f0ba27 Move torch.onnx.operators functions into ATen (#12803)
Summary:
These were indiscriminately dumping `onnx::` instructions into traces, and making it so you couldn't run the traces in the JIT interpreter
Pull Request resolved: https://github.com/pytorch/pytorch/pull/12803

Differential Revision: D10443526

Pulled By: jamesr66a

fbshipit-source-id: 07172004bf31be9f61e498b5772759fe9262e9b3
2018-10-18 16:04:34 -07:00

21 lines
578 B
Python

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