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

Method test_arg_scope

caffe2/python/brew_test.py:96–107  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

94 self.assertEqual(model._Validate(), ["bbb"])
95
96 def test_arg_scope(self):
97 myhelper = self.myhelper
98 myhelper2 = self.myhelper2
99 n = 15
100 with brew.arg_scope([myhelper], val=n):
101 res = brew.myhelper(self.model)
102 self.assertEqual(n, res)
103
104 with brew.arg_scope([myhelper, myhelper2], val=n):
105 res1 = brew.myhelper(self.model)
106 res2 = brew.myhelper2(self.model)
107 self.assertEqual([n, n], [res1, res2])
108
109 def test_arg_scope_single(self):
110 X = np.random.rand(64, 3, 32, 32).astype(np.float32) - 0.5

Callers

nothing calls this directly

Calls 4

arg_scopeMethod · 0.80
myhelperMethod · 0.80
myhelper2Method · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected