ttnn.i1

ttnn.i1(input_tensor: ttnn.Tensor, *, memory_config: ttnn.MemoryConfig = None, output_tensor: ttnn.Tensor = None, sub_core_grids: ttnn.CoreRangeSet = None) ttnn.Tensor

Applies i1 to input_tensor element-wise.

\[\mathrm{{output\_tensor}}_i = I_1(\mathrm{{input\_tensor}}_i)\]
Parameters:

input_tensor (ttnn.Tensor) – the input tensor. [Validated range: -10 to 10]

Keyword Arguments:
  • memory_config (ttnn.MemoryConfig, optional) – memory configuration for the operation. Defaults to None.

  • output_tensor (ttnn.Tensor, optional) – preallocated output tensor. Defaults to None.

  • sub_core_grids (ttnn.CoreRangeSet, optional) – sub core grids for the operation. Defaults to None.

Returns:

ttnn.Tensor – the output tensor.

Note

Supported dtypes and layouts:

Dtypes

Layouts

BFLOAT16, BFLOAT8_B

TILE, ROW_MAJOR

Computes the modified Bessel function of the first kind of order 1.

Example

# Create a tensor with specific values
tensor = ttnn.from_torch(
    torch.tensor([[1.0, 2.0], [3.0, 4.0]], dtype=torch.bfloat16), layout=ttnn.TILE_LAYOUT, device=device
)

# Compute the modified Bessel function of the first kind of order 1
output = ttnn.i1(tensor)
logger.info(f"Bessel i1: {output}")