| 158 | InferenceContext::~InferenceContext() {} |
| 159 | |
| 160 | Status InferenceContext::Run( |
| 161 | const std::function<Status(shape_inference::InferenceContext* c)>& fn) { |
| 162 | ForgetMerges(); |
| 163 | Status s = fn(this); |
| 164 | if (!s.ok()) { |
| 165 | ForgetMerges(); |
| 166 | return AttachContext(s); |
| 167 | } |
| 168 | #ifndef NDEBUG |
| 169 | for (int i = 0; i < num_outputs(); ++i) { |
| 170 | DCHECK(output(i).IsSet()) |
| 171 | << i << " for " << node_def_->name() << " of type " << node_def_->op(); |
| 172 | } |
| 173 | #endif // NDEBUG |
| 174 | return s; |
| 175 | } |
| 176 | |
| 177 | Status InferenceContext::set_output(StringPiece output_name, |
| 178 | const std::vector<ShapeHandle>& shapes) { |