Skip to content

[tmva][sofie] shape and type inference methods need not be pure virtual #18424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tmva/sofie/inc/TMVA/ROperator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class ROperator{
public:
virtual std::vector<std::string> GetBlasRoutines() { return {}; }
virtual std::vector<std::string> GetStdLibs() { return {}; }
virtual std::vector<std::vector<size_t>> ShapeInference(std::vector<std::vector<size_t>>) = 0;
virtual std::vector<ETensorType> TypeInference(std::vector<ETensorType>) = 0;
virtual std::vector<std::vector<size_t>> ShapeInference(std::vector<std::vector<size_t>>) { return {}; };
virtual std::vector<ETensorType> TypeInference(std::vector<ETensorType>) { return {}; };
virtual void Initialize(RModel&) = 0;
virtual std::string Generate(std::string OpName) = 0; //expect unique opName for each operator within the same RModel
// generate initialization code for session constructor
Expand Down
10 changes: 0 additions & 10 deletions tmva/sofie/inc/TMVA/ROperator_Shape.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ public:
fOutputTensorNames = { fNY };
}

std::vector<ETensorType> TypeInference(std::vector<ETensorType> input) override {
return input;
}

std::vector<std::vector<size_t>> ShapeInference(std::vector<std::vector<size_t>> input) override {
std::vector<std::vector<size_t>> ret;
ret[0].push_back(input[0].size());
return ret;
}

void Initialize(RModel& model) override {
if (model.CheckIfTensorAlreadyExist(fNX) == false){ //input must be a graph input, or already initialized intermediate tensor
throw std::runtime_error("TMVA SOFIE Shape Op Input Tensor " + fNX + " is not found in model");
Expand Down
Loading