a8eeb46f0f10ae97c82c09003b2319529b7ce4d3,nn_dataflow/tests/unit_test/test_partition_scheme.py,TestPartitionScheme,test_part_neighbor_dist,#TestPartitionScheme#,160
Before Change
for ps in [self.ps1, self.ps2]:
self.assertTupleEqual(ps.part_neighbor_dist(ps.order[-1]),
(1, 1))
self.assertTupleEqual(ps.part_neighbor_dist(ps.order[-2]),
ps.dim(ps.order[-1]))
self.assertTupleEqual(ps.part_neighbor_dist(ps.order[-3]),
ps.dim(*ps.order[-2:]))
self.assertTupleEqual(ps.part_neighbor_dist(ps.order[-4]),
ps.dim(*ps.order[-3:]))
After Change
nbr_dist = ps.part_neighbor_dist(nr, ps.order[idx])
dim_below = ps.dim(*ps.order[idx + 1:]) if idx + 1 < pe.NUM \
else PhyDim2(1, 1)
dim_cur = ps.dim(ps.order[idx])
if dim_cur.h == 1:
self.assertTrue(math.isinf(nbr_dist.h))
else:
self.assertEqual(nbr_dist.h, dim_below.h)
if dim_cur.w == 1:
self.assertTrue(math.isinf(nbr_dist.w))
else:
self.assertEqual(nbr_dist.w, dim_below.w)
def test_part_neighbor_dist_inv(self):
""" Get part_neighbor_dist invalid arg. """
dist = self.ps1.part_neighbor_dist(self.nr1, pe.NUM)
self.assertTrue(all(math.isnan(d) for d in dist))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: stanford-mast/nn_dataflow
Commit Name: a8eeb46f0f10ae97c82c09003b2319529b7ce4d3
Time: 2017-08-21
Author: mgao12@stanford.edu
File Name: nn_dataflow/tests/unit_test/test_partition_scheme.py
Class Name: TestPartitionScheme
Method Name: test_part_neighbor_dist
Project Name: cornellius-gp/gpytorch
Commit Name: f7b10102a3a0b08272634347ff3a65efd3df18ce
Time: 2019-04-04
Author: gpleiss@gmail.com
File Name: test/functions/test_inv_matmul.py
Class Name: TestInvMatmulNonBatch
Method Name: test_inv_matmul_vec
Project Name: inferno-pytorch/inferno
Commit Name: b8860d3f96b25fcf15b3db17208e34fa28cbb0ff
Time: 2018-08-07
Author: thorsten.beier@iwr.uni-heidelberg.de
File Name: inferno/extensions/layers/building_blocks.py
Class Name: ResBlockBase
Method Name: forward