54 if (model.CheckIfTensorAlreadyExist(
fNInput) ==
false){
55 throw std::runtime_error(
"TMVA SOFIE Tile Op Input Tensor is not found in model");
57 if (model.CheckIfTensorAlreadyExist(
fNRepeats) ==
false){
58 throw std::runtime_error(
"TMVA SOFIE Tile Op Input Tensor is not found in model");
64 if (!model.IsInitializedTensor(
fNRepeats)) {
65 throw std::runtime_error(
"TMVA SOFIE Tile Op: non-initialized repeats input is not supported");
69 auto repptr = model.GetInitializedTensorData(
fNRepeats);
71 auto repeats_data =
static_cast<int64_t*
>(repptr.get());
72 if (repeats_data ==
nullptr) {
73 throw std::runtime_error(
"Failed to retrieve the data for the repeats tensor.");
76 auto repeats_shape = model.GetTensorShape(
fNRepeats);
78 if (repeats_shape.size() != 1) {
79 throw std::runtime_error(
"Repeats tensor is not 1D.");
81 size_t num_elements = repeats_shape[0];
83 std::vector<size_t> repeats_vector(num_elements);
84 std::copy(repeats_data, repeats_data + num_elements, repeats_vector.begin());