unreal.NeuralTensorType

class unreal.NeuralTensorType

Bases: unreal.EnumBase

The type of the neural tensor. E.g., a Weight tensor will be read-only and never modified, an Input tensor will be modified by the user, an IntermediateNotInitialized tensor will change on each frame, etc.

Although conceptually this could apply to both the CPU and GPU versions, in practice only the GPU performance is affected by this setting so far.

C++ Source:

  • Plugin: NeuralNetworkInference

  • Module: NeuralNetworkInference

  • File: NeuralEnumClasses.h

GENERIC

Safe and generic tensor that works in every situation (e.g., ReadWrite, not volatile). However, it might not be the most efficient one for most cases.

Type

0

INPUT

Input tensor of a neural network, usually copied from the CPU and usually ReadOnly (but might be modified by in-place operators like ReLU).

Type

1

INTERMEDIATE_INITIALIZED

Intermediate tensor that is initialized with CPU data (e.g., XWithZeros in FConvTranpose). Copied from CPU.

Type

3

INTERMEDIATE_NOT_INITIALIZED

Intermediate tensor of a neural network (output of at least a layer and input of at least some other layer). Not copied from CPU, ReadWrite, and transient.

Type

2

OUTPUT

Output tensor of a neural network. Not copied from CPU and ReadWrite.

Type

4

WEIGHT

Weights of a particular operator/layer. Copied from CPU, ReadOnly, and initialized from CPU memory.

Type

5