ttnn.ceil
- ttnn.ceil(input_tensor: ttnn.Tensor, *, memory_config: ttnn.MemoryConfig = None, output_tensor: ttnn.Tensor = None) ttnn.Tensor
-
Applies ceil to
input_tensorelement-wise.\[\mathrm{{output\_tensor}}_i = \verb|ceil|(\mathrm{{input\_tensor}}_i)\]- 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.
- Returns:
-
ttnn.Tensor – the output tensor.
Note
Supported dtypes, layouts, and ranks:
Dtypes
Layouts
Ranks
BFLOAT16, BFLOAT8_B
TILE
2, 3, 4
Example
# Create a tensor with random values tensor = ttnn.rand([2, 2], dtype=ttnn.bfloat16, layout=ttnn.TILE_LAYOUT, device=device) # Compute the ceiling (smallest integer greater than or equal to each element) output = ttnn.ceil(tensor) logger.info(f"Ceiling: {output}")