52 if (model.CheckIfTensorAlreadyExist(
fNInput) ==
false){
53 throw std::runtime_error(
"TMVA SOFIE Tile Op Input Tensor is not found in model");
55 if (model.CheckIfTensorAlreadyExist(
fNRepeats) ==
false){
56 throw std::runtime_error(
"TMVA SOFIE Tile Op Input Tensor is not found in model");
62 if (!model.IsInitializedTensor(
fNRepeats)) {
63 throw std::runtime_error(
"TMVA SOFIE Tile Op: non-initialized repeats input is not supported");
67 auto repptr = model.GetInitializedTensorData(
fNRepeats);
69 auto repeats_data =
static_cast<int64_t*
>(repptr.get());
70 if (repeats_data ==
nullptr) {
71 throw std::runtime_error(
"Failed to retrieve the data for the repeats tensor.");
74 auto repeats_shape = model.GetTensorShape(
fNRepeats);
76 if (repeats_shape.size() != 1) {
77 throw std::runtime_error(
"Repeats tensor is not 1D.");
79 size_t num_elements = repeats_shape[0];
81 std::vector<size_t> repeats_vector(num_elements);
82 std::copy(repeats_data, repeats_data + num_elements, repeats_vector.begin());
89 model.SetNotWritableInitializedTensor(
fNRepeats);