Skip to content

Commit

Permalink
Add TorchScript test file (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Sep 14, 2022
1 parent bc237f0 commit 077e00f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/pytorch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2055,6 +2055,10 @@ pytorch.Container.Zip.Execution = class extends pytorch.Execution {
case 'torch.hardtanh_':
case 'torch.upsample_bilinear2d':
case 'ops.prepacked.conv2d_clamp_run': {
const input = evalArgs[0];
if (pytorch.Utility.isTensor(input) && input.size() === undefined) {
input.resize_([ NaN, NaN, NaN, NaN ]);
}
parameter.resize_([ NaN, NaN, NaN, NaN ]);
break;
}
Expand Down Expand Up @@ -2086,6 +2090,7 @@ pytorch.Container.Zip.Execution = class extends pytorch.Execution {
case 'torch.gelu':
case 'torch.relu':
case 'torch.clamp_':
case 'torch._add_relu_':
case 'torch.hardswish_': {
const input = evalArgs[0];
if (pytorch.Utility.isTensor(input) && Array.isArray(input.size())) {
Expand Down
7 changes: 7 additions & 0 deletions test/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -4160,6 +4160,13 @@
"format": "TorchScript v1.6",
"link": "https://github.com/lutzroeder/netron/issues/630"
},
{
"type": "pytorch",
"target": "deeplabv3_scripted.ptl",
"source": "https://github.com/lutzroeder/netron/files/9562007/deeplabv3_scripted.ptl.zip[deeplabv3_scripted.ptl]",
"format": "TorchScript v1.6",
"link": "https://github.com/lutzroeder/netron/issues/842"
},
{
"type": "pytorch",
"target": "DCGAN2.pt",
Expand Down

0 comments on commit 077e00f

Please sign in to comment.