Skip to contents

Computes dot products between windows of lhs and slices of rhs. See https://openxla.org/stablehlo/spec#convolution for details.

All dimension indices are 0-based.

Usage

infer_types_convolution(
  lhs,
  rhs,
  dimension_numbers,
  precision_config,
  window_strides,
  padding,
  lhs_dilation,
  rhs_dilation,
  window_reversal,
  feature_group_count,
  batch_group_count
)

hlo_convolution(
  lhs,
  rhs,
  dimension_numbers,
  window_strides,
  padding,
  lhs_dilation = NULL,
  rhs_dilation = NULL,
  window_reversal = NULL,
  feature_group_count = 1L,
  batch_group_count = 1L,
  precision_config = c("DEFAULT", "DEFAULT"),
  output_types = NULL
)

Arguments

lhs

(FuncValue)
The input tensor (typically [batch, spatial..., feature]).

rhs

(FuncValue)
The kernel tensor.

dimension_numbers

(ConvDimensionNumbers)
The convolution dimension numbers describing the layout of lhs, rhs, and the result.

precision_config

(character(2))
Two precision specifiers (one for each operand), each one of "DEFAULT", "HIGH" or "HIGHEST". Defaults to c("DEFAULT", "DEFAULT").

window_strides

(integer())
Stride of the kernel window in each spatial dimension. Length N - 2 where N = rank(lhs).

padding

(matrix)
[N - 2, 2] integer matrix of (low, high) padding for each spatial dimension.

lhs_dilation

(integer())
Dilation factor applied to lhs (a.k.a. transpose-conv stride). Length N - 2. Defaults to all 1's.

rhs_dilation

(integer())
Dilation factor applied to rhs (a.k.a. atrous-conv rate). Length N - 2. Defaults to all 1's.

window_reversal

(logical())
Whether to reverse the kernel along each spatial dimension. Length N - 2. Defaults to all FALSE.

feature_group_count

(integer(1))
Number of feature groups (for grouped / depthwise convolution). Defaults to 1.

batch_group_count

(integer(1))
Number of batch groups. Defaults to 1.

output_types

(list() of ValueType | NULL)
Output types known ahead of time (e.g. from type inference at trace time). When provided, type inference and its input validation are skipped.

Value

FuncValue