MCPcopy
hub / github.com/tum-pbs/PhiFlow / test_batch_slice

Method test_batch_slice

tests/commit/geom/test__graph.py:25–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23 self.assertEqual((2, 2), sparse_subgraph.edges.shape.sizes)
24
25 def test_batch_slice(self):
26 x = vec(x=[0, 1, 2], y=0)
27 deltas = math.pairwise_differences(x, max_distance=.2, format='coo')
28 distances = math.vec_length(deltas)
29 g = graph(x, distances, {})
30 stacked = stack([g, g], batch('b'))
31 g0 = stacked.b[0]
32 self.assertNotIn('b', g0.nodes.shape)
33 self.assertNotIn('b', g0.edges.shape)

Callers

nothing calls this directly

Calls 2

graphFunction · 0.90
stackFunction · 0.90

Tested by

no test coverage detected