Skip to content

other

torch_to_nnef.op.aten.other

contiguous

contiguous(node, torch_graph, **kwargs)

This does not translate to any operation.

detach

detach(node, torch_graph, **kwargs)

This does not translate to any operation.

dropout

dropout(node, torch_graph, **kwargs)

Map PyTorch: 'aten:dropout' to NNEF.

external

external(g: NGraph, node: TensorVariable, name_to_tensor: T.Dict[str, NTensor], inference_target: InferenceTarget)

Add External NNEF Operation in graph.

numel

numel(node, inference_target, op_helper, **kwargs)

Map PyTorch: 'aten:numel' to NNEF.

scalar_tensor

scalar_tensor(node, inference_target, op_helper, **kwargs)

Map PyTorch: 'aten:scalar_tensor' to NNEF.

size

size(g, node, name_to_tensor, inference_target, torch_graph, op_helper, **kwargs)

Map PyTorch aten::size as NNEF.

We can not use NNEF shape_of that have been deprecated since 1.0.1 version:.

The shape_of function is deprecated and is discouraged from use.
The reason is that it provides syntactic means to access a
property of tensors that is not defined via the syntax itself.

Furthermore, its definition is problematic in cases where the shape
of a tensor is not known in graph compilation time.

These result in problems with custom operations and operations with results
of dynamic shape for a consumer of an NNEF document.

By removing support for the shape_of function from NNEF syntax,
it becomes possible to de-couple parsing
from shape propagation in a consumer of an NNEF document.

Since it is a core component to express some dynamic network that may use tract symbolic dimensions: for example using stream size to apply an averaging: We map it to tract_core_shape_of

to

to(g, node, name_to_tensor, inference_target, **kwargs)

Map PyTorch: 'aten:to' to NNEF.

type_as

type_as(g, node, name_to_tensor, inference_target, **kwargs)

Map PyTorch: 'aten:type_as' to NNEF.