File get_input_tensors.py

Functions

get_input_tensors()
module get_input_tensors

Get all input tensors of runner.

Sample code:

# Each element of the list returned by get_input_tensors() corresponds to a DPU runner input. 
# Each list element has a number of class attributes which can be displayed like this:
inputTensors = dpu_runner.get_input_tensors()
print(dir(inputTensors[0])
# The most useful of these attributes are name, dims and dtype:
for inputTensor in inputTensors:
  print(inputTensor.name)
  print(inputTensor.dims)
  print(inputTensor.dtype)

Note that the dimensions (.dim) of an input tensor are in the form NHWC (batchsize, height,width,channels).

Returns:

List[xir.Tensor]. A list of DPU runner inputs, each of which have type xir.Tensor.

Functions

get_input_tensors()