MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / PreInputInit

Method PreInputInit

tensorflow/core/framework/shape_inference.cc:226–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224string InferenceContext::op() const { return node_def_->op(); }
225
226void InferenceContext::PreInputInit(
227 const OpDef& op_def, const std::vector<const Tensor*>& input_tensors,
228 const std::vector<ShapeHandle>& input_tensors_as_shapes) {
229 input_tensors_ = input_tensors;
230 input_tensors_as_shapes_ = input_tensors_as_shapes;
231
232 construction_status_ = NameRangesForNode(*node_def_, op_def, &input_name_map_,
233 &output_name_map_);
234 if (!construction_status_.ok()) return;
235
236 int num_outputs = 0;
237 for (const auto& e : output_name_map_) {
238 num_outputs = std::max(num_outputs, e.second.second);
239 }
240 outputs_.assign(num_outputs, nullptr);
241 output_handle_shapes_and_types_.resize(num_outputs);
242}
243
244Status InferenceContext::ExpandOutputs(int new_output_size) {
245 if (new_output_size < outputs_.size()) {

Callers

nothing calls this directly

Calls 5

NameRangesForNodeFunction · 0.85
maxFunction · 0.50
okMethod · 0.45
assignMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected