Skip to content

[tmva][sofie] ROperator_Shape::ShapeInference() code can't be correct #18380

Closed
@guitargeek

Description

@guitargeek

Description

The ROperator_Shape::ShapeInference() code can't be correct (I got some compiler warnings):

   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;
   }

The ret vector is empty, so ret[0] is invalid memory access. @sanjibansg, can you please think about what the correct implementation should be? Maybe it's as as easy as pushing one empty element to ret first, right after it's constructed.

Also, this function seems to unnecessarily take a vector<vector<>> by value, as it only reads from the input.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions