Reshape

class dragon.vm.dali.ops.Reshape(
  shape=None,
  **kwargs
)[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 of other tensor
reshape2 = dali.ops.Reshape()
z = reshape2(inputs['x'], inputs['x_shape'])

__new__

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

Create a Reshape operator.

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

nvidia.dali.ops.Reshape The operator.