| 157 | } |
| 158 | |
| 159 | Status OpKernelContext::tensor(const std::string& name, Tensor** tensor) { |
| 160 | *tensor = nullptr; |
| 161 | { |
| 162 | MutexLock l(&mu_); |
| 163 | auto it = tensor_map_.find(name); |
| 164 | if (it == tensor_map_.end()) { |
| 165 | return Status::NotFound("Tensor '", name, "' not found!"); |
| 166 | } |
| 167 | *tensor = it->second; |
| 168 | } |
| 169 | return Status::OK(); |
| 170 | } |
| 171 | |
| 172 | Status OpKernelContext::RemoveAlias(const std::string& name) { |
| 173 | MutexLock l(&mu_); |