Skip to main content
Log in

Mojo function

conv_shape

conv_shape[input_rank: Int, filter_rank: Int, input_type: DType, filter_type: DType, strides_type: DType, dilations_type: DType, paddings_type: DType, single_thread_blocking_override: Bool](input_buf: NDBuffer[input_type, input_rank, origin], filter_buf: NDBuffer[filter_type, filter_rank, origin], strides_buf: NDBuffer[strides_type, 1, origin], dilations_buf: NDBuffer[dilations_type, 1, origin], paddings_buf: NDBuffer[paddings_type, 1, origin], num_groups_scalar: SIMD[dtype, 1]) -> Index[input_rank]

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

Parameters:

  • input_rank (Int): Rank of the input tensor.
  • filter_rank (Int): Rank of the filter tensor.
  • input_type (DType): Type of the input tensor.
  • filter_type (DType): Type of the filter tensor.
  • strides_type (DType): Type of the strides tensor.
  • dilations_type (DType): Type of the dilations tensor.
  • paddings_type (DType): Type of the paddings tensor.
  • single_thread_blocking_override (Bool): If True, then the operation is run ssynchronouslysing a single thread.

Args:

  • input_buf (NDBuffer[input_type, input_rank, origin]): The input tensor.
  • filter_buf (NDBuffer[filter_type, filter_rank, origin]): The filter tensor.
  • strides_buf (NDBuffer[strides_type, 1, origin]): The strides tensor.
  • dilations_buf (NDBuffer[dilations_type, 1, origin]): The dilations tensor.
  • paddings_buf (NDBuffer[paddings_type, 1, origin]): The paddings tensor.
  • num_groups_scalar (SIMD[dtype, 1]): The num_groups scalar.

Returns:

The output shape.

Was this page helpful?