Skip to main content

function

reduce_shape

reduce_shape[input_rank: Int, input_type: DType, axis_type: DType, single_thread_blocking_override: Bool](input_buf: NDBuffer[input_type, input_rank, create_unknown[stdlib::builtin::int::Int](), 0], axis_buf: NDBuffer[axis_type, 1, create_unknown[stdlib::builtin::int::Int](), 0]) -> StaticIntTuple[$0]

Compute the output shape of a pad operation, and assert the inputs are compatible.

Parameters:

  • input_rank (Int): Input_rank of the input tensor.
  • input_type (DType): Type of the input tensor.
  • axis_type (DType): Type of the axis tensor.
  • single_thread_blocking_override (Bool): If True, then the operation is run synchronously using a single thread.

Args:

  • input_buf (NDBuffer[input_type, input_rank, create_unknown[stdlib::builtin::int::Int](), 0]): The input tensor.
  • axis_buf (NDBuffer[axis_type, 1, create_unknown[stdlib::builtin::int::Int](), 0]): The axis tensor.

Returns:

The output shape.