(self, fn_name, a, b)
| 238 | return self._get_output_info(x.id) |
| 239 | |
| 240 | def _binary(self, fn_name, a, b): |
| 241 | a = self._ensure_tensor(a) |
| 242 | b = self._ensure_tensor(b) |
| 243 | out = cactus_node_t() |
| 244 | rc = getattr(_lib, fn_name)(self.h, cactus_node_t(a.id), cactus_node_t(b.id), ctypes.byref(out)) |
| 245 | if rc != 0: |
| 246 | raise RuntimeError(f"{fn_name} failed") |
| 247 | return self._tensor_from_node(out.value) |
| 248 | |
| 249 | def _ensure_tensor(self, x): |
| 250 | if not isinstance(x, Tensor): |
no test coverage detected