MCPcopy Index your code
hub / github.com/pytorch/pytorch / _expected_loop

Method _expected_loop

caffe2/python/net_builder_test.py:106–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

104 self.assertEqual(actual, expected)
105
106 def _expected_loop(self):
107 total = 0
108 total_large = 0
109 total_small = 0
110 total_tiny = 0
111 for loop_iter in range(10):
112 outer = loop_iter * 10
113 for inner_iter in range(loop_iter):
114 val = outer + inner_iter
115 if val >= 80:
116 total_large += val
117 elif val >= 50:
118 total_small += val
119 else:
120 total_tiny += val
121 total += val
122 return total, total_large, total_small, total_tiny
123
124 def _actual_loop(self):
125 total = ops.Const(0)

Callers 1

test_loopsMethod · 0.95

Calls 1

rangeFunction · 0.50

Tested by

no test coverage detected