Skip to main content
Log in

Mojo function

prod_dims

prod_dims[start_dim: Int, end_dim: Int](x: NDBuffer[type, rank, shape, strides, alignment=alignment, address_space=address_space, exclusive=exclusive]) -> Int

Computes the product of a slice of the given buffer's dimensions.

Parameters:

  • start_dim (Int): The index at which to begin computing the product.
  • end_dim (Int): The index at which to stop computing the product.

Args:

  • x (NDBuffer[type, rank, shape, strides, alignment=alignment, address_space=address_space, exclusive=exclusive]): The NDBuffer whose dimensions will be multiplied.

Returns:

The product of the specified slice of the buffer's dimensions.