(self)
| 162 | self.assertFalse(brew.has_helper(myhelper3)) |
| 163 | |
| 164 | def test_model_helper(self): |
| 165 | X = np.random.rand(64, 32, 32, 3).astype(np.float32) - 0.5 |
| 166 | |
| 167 | workspace.FeedBlob("x", X) |
| 168 | my_arg_scope = {'order': 'NHWC'} |
| 169 | model = ModelHelper(name="test_model", arg_scope=my_arg_scope) |
| 170 | with brew.arg_scope( |
| 171 | brew.conv, |
| 172 | stride=2, |
| 173 | pad=2, |
| 174 | weight_init=('XavierFill', {}), |
| 175 | bias_init=('ConstantFill', {}) |
| 176 | ): |
| 177 | brew.conv( |
| 178 | model=model, |
| 179 | blob_in="x", |
| 180 | blob_out="out", |
| 181 | dim_in=3, |
| 182 | dim_out=64, |
| 183 | kernel=[8, 3] |
| 184 | ) |
| 185 | model.Validate() |
| 186 | workspace.RunNetOnce(model.param_init_net) |
| 187 | workspace.RunNetOnce(model.net) |
| 188 | out = workspace.FetchBlob("out") |
| 189 | self.assertEqual(out.shape, (64, 15, 17, 64)) |
| 190 | |
| 191 | def test_cnn_model_helper_deprecated(self): |
| 192 | X = np.random.rand(64, 32, 32, 3).astype(np.float32) - 0.5 |
nothing calls this directly
no test coverage detected