Skip to content

Commit

Permalink
Workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Jul 12, 2023
1 parent 010a48d commit f30b94f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions RecoMET/METPUSubtraction/plugins/DeepMETProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,18 @@ DeepMETProducer::DeepMETProducer(const edm::ParameterSet& cfg, const tensorflow:
max_n_pf_(cfg.getParameter<unsigned int>("max_n_pf")),
session_(cache->getSession()) {
produces<pat::METCollection>();

const tensorflow::TensorShape shape({1, max_n_pf_, 8});
const tensorflow::TensorShape cat_shape({1, max_n_pf_, 1});

// Workaround for missing constructor TensorShape::TensorShape(absl::Slice<long>),
// the constructor expects Slice<int64> or initializer_list<int64> and is marked explicit
const tensorflow::TensorShape shape;
shape.AddDim(1);
shape.AddDim(max_n_pf_);
shape.AddDim(8);

const tensorflow::TensorShape cat_shape;
shape.AddDim(1);
shape.AddDim(max_n_pf_);
shape.AddDim(1);

input_ = tensorflow::Tensor(tensorflow::DT_FLOAT, shape);
input_cat0_ = tensorflow::Tensor(tensorflow::DT_FLOAT, cat_shape);
Expand Down

0 comments on commit f30b94f

Please sign in to comment.