ttnn.lgamma
- ttnn.lgamma(input_tensor: ttnn.Tensor, *, memory_config: ttnn.MemoryConfig = None, output_tensor: ttnn.Tensor = None, sub_core_grids: ttnn.CoreRangeSet = None) ttnn.Tensor
-
Applies lgamma to
input_tensorelement-wise.\[Computes natural logarithm of the gamma function on :attr:`input_tensor`.\]- Parameters:
-
input_tensor (ttnn.Tensor) – the input tensor.
- 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, FLOAT32
TILE, ROW_MAJOR
Example
# Create a tensor with random values tensor = ttnn.rand([2, 2], dtype=ttnn.bfloat16, layout=ttnn.TILE_LAYOUT, device=device) # Compute the log gamma function output = ttnn.lgamma(tensor) logger.info(f"Log gamma: {output}")