UFF Parser

tensorrt.UffInputOrder

The different possible supported input orders.

Members:

NCHW

NHWC

NC

class tensorrt.UffParser(self: tensorrt.tensorrt.UffParser) None

This class is used for parsing models described using the UFF format.

Variables
  • uff_required_version_majorint Version Major of the UFF.

  • uff_required_version_minorint Version Minor of the UFF.

  • uff_required_version_patchint Version Patch of the UFF.

  • plugin_namespacestr The namespace used to lookup and create plugins in the network.

  • error_recorderIErrorRecorder Application-implemented error reporting interface for TensorRT objects.

__del__(self: tensorrt.tensorrt.UffParser) None
__exit__(exc_type, exc_value, traceback)

Context managers are deprecated and have no effect. Objects are automatically freed when the reference count reaches 0.

__init__(self: tensorrt.tensorrt.UffParser) None
parse(self: tensorrt.tensorrt.UffParser, file: str, network: tensorrt.tensorrt.INetworkDefinition, weights_type: tensorrt.tensorrt.DataType = <DataType.FLOAT: 0>) bool

Parse a UFF file.

Parameters
  • file – File name of the UFF file.

  • network – Network in which the UffParser will fill the layers.

  • weights_type – The type on which the weights will be transformed in.

Returns

True if the UFF file is parsed without error.

parse_buffer(self: tensorrt.tensorrt.UffParser, buffer: buffer, network: tensorrt.tensorrt.INetworkDefinition, weights_type: tensorrt.tensorrt.DataType = <DataType.FLOAT: 0>) bool

Parse a UFF buffer - useful if the file is already live in memory.

Parameters
  • buffer – The UFF buffer.

  • network – Network in which the UFFParser will fill the layers.

  • weights_type – The type on which the weights will be transformed in.

Returns

True if the UFF buffer is parsed without error.

register_input(self: tensorrt.tensorrt.UffParser, name: str, shape: tensorrt.tensorrt.Dims, order: tensorrt.tensorrt.UffInputOrder = <UffInputOrder.NCHW: 0>) bool

Register an input name of a UFF network with the associated Dimensions.

Parameters
  • name – Input name.

  • shape – Input shape.

  • order – Input order on which the framework input was originally.

Returns

True if the name registers without error.

register_output(self: tensorrt.tensorrt.UffParser, name: str) bool

Register an output name of a UFF network.

Parameters

output_name – Output name.

Returns

True if the name registers without error.