MCPcopy Create free account
hub / github.com/cactus-compute/cactus / input

Method input

python/src/graph.py:38–45  ·  view source on GitHub ↗
(self, shape, dtype=FP16)

Source from the content-addressed store, hash-verified

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):

Callers 15

test_pow_absMethod · 0.95
test_subtractMethod · 0.95
test_addMethod · 0.95
test_multiplyMethod · 0.95
test_divideMethod · 0.95
test_viewMethod · 0.95
test_flattenMethod · 0.95
test_concatMethod · 0.95
test_cat_1dMethod · 0.95
test_cat_2d_axis1Method · 0.95
test_reluMethod · 0.95

Calls 1

_tensor_from_nodeMethod · 0.95

Tested by 15

test_pow_absMethod · 0.76
test_subtractMethod · 0.76
test_addMethod · 0.76
test_multiplyMethod · 0.76
test_divideMethod · 0.76
test_viewMethod · 0.76
test_flattenMethod · 0.76
test_concatMethod · 0.76
test_cat_1dMethod · 0.76
test_cat_2d_axis1Method · 0.76
test_reluMethod · 0.76