We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c56e78 commit 2a07185Copy full SHA for 2a07185
mindcv/models/vit.py
@@ -329,7 +329,9 @@ def get_num_layers(self):
329
def _init_weights(self):
330
w = self.patch_embed.proj.weight
331
w_shape_flatted = (w.shape[0], functools.reduce(lambda x, y: x*y, w.shape[1:]))
332
- w.set_data(initializer(XavierUniform(), w_shape_flatted, w.dtype).reshape(w.shape))
+ w_value = initializer(XavierUniform(), w_shape_flatted, w.dtype)
333
+ w_value.init_data()
334
+ w.set_data(w_value.reshape(w.shape))
335
for _, cell in self.cells_and_names():
336
if isinstance(cell, nn.Dense):
337
cell.weight.set_data(
0 commit comments