MCPcopy Index your code
hub / github.com/DeepGraphLearning/S3F / diagonal_ranges

Function diagonal_ranges

s3f/surface.py:30–40  ·  view source on GitHub ↗

Encodes the block-diagonal structure associated to a batch vector.

(batch_x=None, batch_y=None)

Source from the content-addressed store, hash-verified

28
29
30def diagonal_ranges(batch_x=None, batch_y=None):
31 """Encodes the block-diagonal structure associated to a batch vector."""
32 if batch_x is None and batch_y is None:
33 return None # No batch processing
34 elif batch_y is None:
35 batch_y = batch_x # "symmetric" case
36
37 ranges_x, slices_x = ranges_slices(batch_x)
38 ranges_y, slices_y = ranges_slices(batch_y)
39
40 return ranges_x, slices_x, ranges_y, ranges_y, slices_y, ranges_x
41
42
43def knn_atoms(x, y, k, batch_x=None, batch_y=None):

Callers 2

knn_atomsFunction · 0.85
soft_distancesFunction · 0.85

Calls 1

ranges_slicesFunction · 0.85

Tested by

no test coverage detected