ttnn.i1
- ttnn.i1(input_tensor: ttnn.Tensor, *, memory_config: ttnn.MemoryConfig = None, output_tensor: ttnn.Tensor = None) ttnn.Tensor
-
Applies i1 to
input_tensorelement-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.
- Returns:
-
ttnn.Tensor – the output tensor.
Note
Supported dtypes, layouts, and ranks:
Dtypes
Layouts
Ranks
BFLOAT16, BFLOAT8_B
TILE
2, 3, 4
Computes the modified Bessel function of the first kind of order 1. This function is commonly used in physics and engineering, particularly in problems with cylindrical symmetry.
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}")