MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / process

Method process

Compiler/ml.py:1463–1473  ·  view source on GitHub ↗
(pool, bi, k, i, j)

Source from the content-addressed store, hash-verified

1461 @_layer_method_call_tape
1462 def _forward(self, batch, training):
1463 def process(pool, bi, k, i, j):
1464 def m(a, b):
1465 c = a[0] > b[0]
1466 l = [c * x for x in a[1]]
1467 l += [(1 - c) * x for x in b[1]]
1468 return c.if_else(a[0], b[0]), l
1469 red = util.tree_reduce(m, [(x[0], [1] if training else [])
1470 for x in pool])
1471 self.Y[bi][i][j][k] = red[0]
1472 for ii, x in enumerate(red[1]):
1473 self.comparisons[bi][k][i][j][ii] = x
1474 self.traverse(batch, process)
1475
1476 def backward(self, compute_nabla_X=True, batch=None):

Callers

nothing calls this directly

Calls 4

zipFunction · 0.85
get_programFunction · 0.85
tree_reduceMethod · 0.80
protect_memoryMethod · 0.80

Tested by

no test coverage detected