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

Method test_arg_scope_single

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

Source from the content-addressed store, hash-verified

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
111
112 workspace.FeedBlob("x", X)
113 model = ModelHelper(name="test_model")
114 with brew.arg_scope(
115 brew.conv,
116 stride=2,
117 pad=2,
118 weight_init=('XavierFill', {}),
119 bias_init=('ConstantFill', {})
120 ):
121 brew.conv(
122 model=model,
123 blob_in="x",
124 blob_out="out",
125 dim_in=3,
126 dim_out=64,
127 kernel=3,
128 )
129 model.Validate()
130 workspace.RunNetOnce(model.param_init_net)
131 workspace.RunNetOnce(model.net)
132 out = workspace.FetchBlob("out")
133 self.assertEqual(out.shape, (64, 64, 17, 17))
134
135 def test_arg_scope_nested(self):
136 myhelper = self.myhelper

Callers

nothing calls this directly

Calls 7

ValidateMethod · 0.95
ModelHelperClass · 0.90
astypeMethod · 0.80
arg_scopeMethod · 0.80
randMethod · 0.45
convMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected