# Shape¶

Outputs the shape of the input tensor into the output tensor.

## Inputs¶

input: tensor of type T1.

## Outputs¶

output: tensor of type T2.

## Data Types¶

T1: bool, int8, int32, float16, float32

T2: int32

## Shape Information¶

input is a tensor with a shape of $$[a_0,...,a_n]$$, $$n \geq 1$$.

output is a 1D shape tensor, where its values are $$[a_0,...,a_n]$$. Refer to Execution Tensors vs. Shape Tensors for more information on shape tensors.

## Examples¶

Shape
in1 = network.add_input("input1", dtype=trt.float32, shape=(1, 5, 2, 2))
network.mark_output(shape.get_output(0))

inputs[in1.name] = np.zeros(shape=(1, 5, 2, 2))

outputs[shape.get_output(0).name] = shape.get_output(0).shape
expected[shape.get_output(0).name] = np.array([1, 5, 2, 2])