(self, shape, dtype=FP16)
| 36 | self.h = None |
| 37 | |
| 38 | def input(self, shape, dtype=FP16): |
| 39 | shape = tuple(int(x) for x in shape) |
| 40 | arr = (ctypes.c_size_t * len(shape))(*shape) |
| 41 | out = cactus_node_t() |
| 42 | rc = _lib.cactus_graph_input(self.h, arr, len(shape), int(dtype), ctypes.byref(out)) |
| 43 | if rc != 0: |
| 44 | raise RuntimeError("graph_input failed") |
| 45 | return self._tensor_from_node(out.value) |
| 46 | |
| 47 | def set_input(self, tensor, data, dtype=None): |
| 48 | if not isinstance(tensor, Tensor): |