18#include "kernels/Utils.h"
34 switch (
axis()->element_type())
36 case loco::DataType::S32:
39 case loco::DataType::S64:
43 throw std::runtime_error(
"luci-intp ExpandDims Unsupported type.");
79 const auto *input_data =
input()->
data<
void>();
86 if (num_elements < 0 ||
static_cast<uint64_t>(num_elements) >
SIZE_MAX / element_size)
88 throw std::runtime_error(
"Integer overflow in size calculation");
91 const int64_t total_size = num_elements * element_size;
92 std::memcpy(output_data, input_data,
static_cast<size_t>(total_size));
int64_t large_num_elements() const
void resize(const Shape &new_shape)
const Shape & shape() const
const Tensor * axis() const
void execute() const override
void configure() override
const Tensor * input() const
ExpandDims(const Tensor *input, const Tensor *axis, Tensor *output)
#define LUCI_INTERPRETER_CHECK(cond)
const luci_interpreter::RuntimeShape output_shape
size_t getDataTypeSize(DataType data_type)
T must_cast(loco::Node *node)