(pool, bi, k, i, j)
| 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): |
nothing calls this directly
no test coverage detected