| 252 | } |
| 253 | |
| 254 | Status OpKernelConstruction::allocate_persistent( |
| 255 | DataType type, const TensorShape& shape, PersistentTensor* out_persistent, |
| 256 | Tensor** out_tensor) { |
| 257 | // for now just do the same thing as allocate_temp |
| 258 | // TODO(misard) add specific memory tracking for persistent tensors |
| 259 | Tensor persistent; |
| 260 | Status s = allocate_temp(type, shape, &persistent); |
| 261 | if (!s.ok()) { |
| 262 | return s; |
| 263 | } |
| 264 | *out_persistent = PersistentTensor(persistent); |
| 265 | Tensor* allocated = out_persistent->AccessTensor(this); |
| 266 | if (out_tensor) { |
| 267 | *out_tensor = allocated; |
| 268 | } |
| 269 | return s; |
| 270 | } |
| 271 | |
| 272 | // OpKernelContext ----------------------------------------------------------- |
| 273 |
no test coverage detected