Encode a ResourceHandle proto as custom numpy struct type.
(resource_handle)
| 34 | |
| 35 | |
| 36 | def encode_resource_handle(resource_handle): |
| 37 | """Encode a ResourceHandle proto as custom numpy struct type.""" |
| 38 | return np.asarray(bytearray(resource_handle.SerializeToString()), |
| 39 | dtype=dtypes.np_resource) |
| 40 | |
| 41 | |
| 42 | class TensorHandle(object): |
no test coverage detected