Represents a TensorProto that cannot be converted to np.ndarray.
| 57 | |
| 58 | |
| 59 | class InconvertibleTensorProto(object): |
| 60 | """Represents a TensorProto that cannot be converted to np.ndarray.""" |
| 61 | |
| 62 | def __init__(self, tensor_proto, initialized=True): |
| 63 | """Constructor. |
| 64 | |
| 65 | Args: |
| 66 | tensor_proto: the `TensorProto` object that cannot be represented as a |
| 67 | `np.ndarray` object. |
| 68 | initialized: (`bool`) whether the Tensor is initialized. |
| 69 | """ |
| 70 | self._tensor_proto = tensor_proto |
| 71 | self._initialized = initialized |
| 72 | |
| 73 | def __str__(self): |
| 74 | output = "" if self._initialized else "Uninitialized tensor:\n" |
| 75 | output += str(self._tensor_proto) |
| 76 | return output |
| 77 | |
| 78 | @property |
| 79 | def initialized(self): |
| 80 | return self._initialized |
| 81 | |
| 82 | |
| 83 | def load_tensor_from_event_file(event_file_path): |
no outgoing calls
no test coverage detected