Skip to main content

Mojo function

layer_norm_shape

layer_norm_shape[dtype: DType, single_thread_blocking_override: Bool](input: TileTensor[dtype, LayoutType, origin, address_space=address_space, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], gamma: TileTensor[dtype, LayoutType, origin, address_space=address_space, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], beta: TileTensor[dtype, LayoutType, origin, address_space=address_space, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types], epsilon: Scalar[dtype]) -> IndexList[TileTensor[dtype, LayoutType, origin, address_space=address_space, linear_idx_type=linear_idx_type, element_shape_types=element_shape_types].rank]

Compute the output shape of a layer_norm operation.

Parameters:

  • dtype (DType): Type of the input tensors.
  • single_thread_blocking_override (Bool): If True, then the operation is run synchronously using a single thread.

Args:

  • input (TileTensor): The input tensor.
  • gamma (TileTensor): The tensor for gamma coefficient.
  • beta (TileTensor): The tensor for beta coefficient.
  • epsilon (Scalar): The tensor for epsilon coefficient.

Returns:

IndexList: The output shape.

Was this page helpful?