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

Method test_arg_scope_nested

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

Source from the content-addressed store, hash-verified

133 self.assertEqual(out.shape, (64, 64, 17, 17))
134
135 def test_arg_scope_nested(self):
136 myhelper = self.myhelper
137 n = 16
138 with brew.arg_scope([myhelper], val=-3), \
139 brew.arg_scope([myhelper], val=-2):
140 with brew.arg_scope([myhelper], val=n):
141 res = brew.myhelper(self.model)
142 self.assertEqual(n, res)
143 res = brew.myhelper(self.model)
144 self.assertEqual(res, -2)
145
146 res = brew.myhelper(self.model, val=15)
147 self.model.Validate()
148 self.assertEqual(res, 15)
149
150 def test_double_register(self):
151 myhelper = self.myhelper

Callers

nothing calls this directly

Calls 4

arg_scopeMethod · 0.80
myhelperMethod · 0.80
ValidateMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected