"Fossies" - the Fresh Open Source Software Archive

Member "pytorch-1.8.2/docs/source/jit_unsupported.rst" (23 Jul 2021, 2902 Bytes) of package /linux/misc/pytorch-1.8.2.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

TorchScript Unsupported Pytorch Constructs

Torch and Tensor Unsupported Attributes

TorchScript supports most methods defined on torch and torch.Tensor, but we do not have full coverage. Here are specific known ops and categories of ops which have diverging behavior between Python and TorchScript. If you encounter something else that is not supported please file a GitHub issue. Deprecated ops are not listed below.


Functions Not Correctly Bound on Torch

The following functions will fail if used in TorchScript, either because they are not bound on torch or because Python expects a different schema than TorchScript.

Ops With Divergent Schemas Between Torch & Python

The following categories of ops have divergent schemas:

Functions which construct tensors from non-tensor inputs do not support the requires_grad argument, except for torch.tensor. This covers the following ops:

The following functions require dtype, layout, device as parameters in TorchScript, but these parameters are optional in Python.

PyTorch Unsupported Modules and Classes

TorchScript cannot currently compile a number of other commonly used PyTorch constructs. Below are listed the modules that TorchScript does not support, and an incomplete list of PyTorch classes that are not supported. For unsupported modules we suggest using torch.jit.trace.