MCPcopy Index your code
hub / github.com/waleedka/hiddenlayer / test_fold

Method test_fold

tests/test_ge.py:223–239  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

221 self.assertEqual(g["b"].op, "x")
222
223 def test_fold(self):
224 g = hl.Graph()
225 a = hl.Node(uid="a", name="a", op="a")
226 b = hl.Node(uid="b", name="b", op="b")
227 c = hl.Node(uid="c", name="c", op="c")
228 d = hl.Node(uid="d", name="d", op="d")
229 g.add_node(a)
230 g.add_node(b)
231 g.add_node(c)
232 g.add_node(d)
233 g.add_edge(a, b)
234 g.add_edge(b, c)
235 g.add_edge(b, d)
236
237 t = ht.Fold("a > b", "ab")
238 g = t.apply(g)
239 self.assertEqual(g.incoming(g["c"])[0].op, "ab")
240
241 def test_parallel_fold(self):
242 g = hl.Graph()

Callers

nothing calls this directly

Calls 4

add_nodeMethod · 0.95
add_edgeMethod · 0.95
applyMethod · 0.95
incomingMethod · 0.95

Tested by

no test coverage detected