MCPcopy Create free account
hub / github.com/pytorch/pytorch / testLRN

Method testLRN

caffe2/python/gradient_check_test.py:72–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

70 self.test_configs = [(6, 10), (3, 13), ]
71
72 def testLRN(self):
73 for input_size, depth in self.test_configs:
74 op = core.CreateOperator("LRN",
75 ["X"],
76 ["Y", "Y_scale"],
77 size=11,
78 alpha=0.001,
79 beta=0.5,
80 bias=2.0,
81 order="NHWC"
82 )
83 X = np.random.rand(2, input_size, input_size,
84 depth).astype(np.float32)
85 res = device_checker.CheckSimple(op, [X], [0])
86 self.assertTrue(res)
87 for checker in gradient_checkers:
88 res, grad, grad_estimated = checker.CheckSimple(op, [X], 0, [0])
89 self.assertTrue(res)
90
91
92class TestFlatten(test_util.TestCase):

Callers

nothing calls this directly

Calls 3

astypeMethod · 0.80
randMethod · 0.45
CheckSimpleMethod · 0.45

Tested by

no test coverage detected