ttnn.angle

ttnn.angle(input_tensor: ComplexTensor, *, memory_config: ttnn.MemoryConfig = None) ttnn.Tensor

Performs complex operations for angle of input_tensor.

Parameters:

input_tensor (ComplexTensor) – the input tensor.

Keyword Arguments:

memory_config (ttnn.MemoryConfig, optional) – Memory configuration for the operation. Defaults to None.

Returns:

ttnn.Tensor – the output tensor.

Example

# Create a complex tensor
tensor = ttnn.to_device(ttnn.from_torch(torch.tensor((0, 1), dtype=torch.bfloat16)), device=device)

# Get the angle (phase) of the complex tensor
output = ttnn.angle(tensor)
logger.info(f"Angle: {output}")