diff --git a/source/pytorch.js b/source/pytorch.js index 09153f35c7..bf668fe9c9 100644 --- a/source/pytorch.js +++ b/source/pytorch.js @@ -160,7 +160,7 @@ pytorch.Graph = class { case '__torch__.torch.classes.quantized.Conv2dPackedParamsBase': { for (const [key, tensor] of Object.entries(value)) { if (pytorch.Utility.isTensor(tensor)) { - initializers.set(value, new pytorch.Tensor(`${name}.${key}`, tensor)); + initializers.set(tensor, new pytorch.Tensor(`${name}.${key}`, tensor)); } } break; diff --git a/test/models.json b/test/models.json index 652f4cecd3..a66e8b1f2a 100644 --- a/test/models.json +++ b/test/models.json @@ -5252,6 +5252,7 @@ "target": "model.ptl", "source": "https://github.com/lutzroeder/netron/files/11149538/model.ptl.zip[model.ptl]", "format": "TorchScript v1.6", + "assert": "model.graphs[0].nodes[0].inputs[1].value[0].initializer.name == 'CONSTANTS.c0.weight'", "link": "https://github.com/lutzroeder/netron/issues/1067" }, {