(self)
| 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 |
nothing calls this directly
no test coverage detected