in src/inplace_abn.cpp [59:94]
void forward(
at::Tensor& x,
const at::Tensor& mean,
const at::Tensor& var,
const c10::optional<at::Tensor>& weight,
const c10::optional<at::Tensor>& bias,
float eps,
Activation activation,
float activation_param) {
// Check dimensions and types
IABN_CHECK(x.ndimension() >= 2, "x should have at least 2 dimensions");
IABN_CHECK(
is_compatible_stat(x, mean),
"mean is not compatible with x (wrong size or scalar type)");
IABN_CHECK(
is_compatible_stat(x, var),
"var is not compatible with x (wrong size or scalar type)");
if (weight.has_value())
IABN_CHECK(
is_compatible_weight(x, weight.value()),
"weight is not compatible with x (wrong size or scalar type)");
if (bias.has_value())
IABN_CHECK(
is_compatible_weight(x, bias.value()),
"bias is not compatible with x (wrong size or scalar type)");
if (weight.has_value() && bias.has_value())
CHECK_SAME_TYPE(weight.value(), bias.value());
IABN_CHECK(
(weight.has_value() && bias.has_value()) ||
(!weight.has_value() && !bias.has_value()),
"weight and bias must be equally present or not present");
CUDA_DISPATCH(
x, forward, x, mean, var, weight, bias, eps, activation, activation_param)
}