Sets `out_context` a new DeviceContext* for executing a graph, or nullptr if the device does not support contexts. Returns an error status if any error occurred while trying to create a context, otherwise OK. The caller takes ownership of one reference on the output DeviceContext*, and should call Unref().
| 157 | // The caller takes ownership of one reference on the output DeviceContext*, |
| 158 | // and should call Unref(). |
| 159 | virtual Status TryGetDeviceContext(DeviceContext** out_context) { |
| 160 | *out_context = nullptr; |
| 161 | return Status::OK(); |
| 162 | } |
| 163 | |
| 164 | // Returns the op segment of this device. The caller can reuse op |
| 165 | // kernels registered for the same session running on this device. |