ttnn.sum

ttnn.sum(input_a: ttnn.Tensor, dim: number, *, memory_config: ttnn.MemoryConfig | None = None) ttnn.Tensor
Parameters:
  • input_a (ttnn.Tensor) – the input tensor.

  • dim (number) – dimension value .

Keyword Arguments:

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

Returns:

ttnn.Tensor – the output tensor.

Example

>>> input_a = ttnn.to_device(ttnn.from_torch(torch.tensor((1, 2), dtype=torch.bfloat16)), device=device)
>>> output = ttnn.sum(input_a, dim, memory_config)