ttnn.permute

ttnn.permute = FastOperation(python_fully_qualified_name='ttnn.permute', function=<ttnn._ttnn.operations.data_movement.permute_t object>, preprocess_golden_function_inputs=<function default_preprocess_golden_function_inputs>, golden_function=<function _golden_function>, postprocess_golden_function_outputs=<function default_postprocess_golden_function_outputs>, is_cpp_operation=True, is_experimental=False)

Permutes the dimensions of the input tensor according to the specified permutation.

Args:

input_tensor (ttnn.Tensor): the input tensor. dim (number): tthe permutation of the dimensions of the input tensor.

Keyword Args:

memory_config (ttnn.MemoryConfig, optional): Memory configuration for the operation. Defaults to None. queue_id (int, optional): command queue id. Defaults to 0. pad_value (float, optional): padding value for when tiles are broken in a transpose. Defaults to 0.0. If set to None, it will be random garbage values.

Returns:

List of ttnn.Tensor: the output tensor.

Example:

>>> tensor = ttnn.to_device(ttnn.from_torch(torch.zeros((1, 1, 64, 32), dtype=torch.bfloat16)), device)
>>> output = ttnn.permute(tensor, (0, 1, 3, 2))
>>> print(output.shape)
[1, 1, 32, 64]