Reshape

class dragon.vm.dali.ops.Reshape[source]

Change the dimensions of input.

Examples:

# Reshape to a constant shape
reshape1 = dali.ops.Reshape(shape=(2, 3))
y = reshape1(inputs['x'])

# Reshape to the shape given by another tensor
reshape2 = dali.ops.Reshape()
z = reshape2(inputs['x'], inputs['x_shape'])

__new__

static Reshape.__new__(
  cls,
  shape=None
)[source]

Create a Reshape operator.

Parameters:
  • shape (Sequence[int], optional) – The optional output shape.
Returns:

nvidia.dali.ops.Reshape – The operator.