48 const auto *options = cur_op->builtin_options_as_MirrorPadOptions();
50 const auto offset = options->mode() != circle::MirrorPadMode_REFLECT ? 0 : 1;
51 const auto input_dims = Tensor::num_dims(kernel.
input1());
52 const auto output_size = Tensor::num_elements(kernel.
output());
54 int output_dims_num_elements[5];
55 int input_dims_num_elements[5];
57 for (
int i = 0; i < input_dims; i++)
59 output_dims_num_elements[i] = 1;
60 input_dims_num_elements[i] = 1;
63 for (
int i = input_dims - 2; i >= 0; i--)
65 output_dims_num_elements[i] =
68 input_dims_num_elements[i] =
72 switch (Tensor::element_type(kernel.
input1()))
75 case DataType::FLOAT32:
78 Tensor::element_type(kernel.
input2()),
data.input2_data,
79 wrap(kernel.
input1()->shape()).data(), output_dims_num_elements, input_dims_num_elements,
80 kernels::getTensorData<float>(
data.input1_data),
81 kernels::getTensorData<float>(
data.output_data),
offset, input_dims, output_size);
87 assert(
false &&
"Unsupported type");
void MirrorPad(const luci_interpreter::DataType padding_matrix_type, const uint8_t *padding_matrix_data, const int32_t *input_dims, int *output_dims_num_elements, int *input_dims_num_elements, const T *input_data, T *output_data, const int offset, const int num_dims, const int output_size)