Skip to content

Commit

Permalink
TorchScript 1.4 prototype (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Jan 19, 2020
1 parent fb1d08d commit 6074cc9
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 179 deletions.
7 changes: 6 additions & 1 deletion src/pickle.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,12 @@ pickle.Unpickler = class {
const state = stack.pop();
let obj = stack.pop();
if (obj.__setstate__) {
obj.__setstate__(state);
if (obj.__setstate__.__call__) {
obj.__setstate__.__call__([ obj, state ]);
}
else {
obj.__setstate__(state);
}
}
else {
for (const p in state) {
Expand Down
52 changes: 51 additions & 1 deletion src/pytorch-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,51 @@
}
},
{
"name": "torch.conv2d_relu",
"name": "ops.quantized.conv2d",
"schema": {
"attributes": [
{
"default": 1,
"name": "stride",
"type": "int64[]"
},
{
"default": 0,
"name": "padding",
"type": "int64[]"
},
{
"default": 1,
"name": "dilation",
"type": "int64[]"
},
{
"default": 1,
"name": "groups",
"type": "int64"
}
],
"category": "Layer",
"inputs": [
{
"name": "input"
},
{
"name": "weight"
},
{
"name": "bias"
}
],
"outputs": [
{
"name": "output"
}
]
}
},
{
"name": "ops.quantized.conv2d_relu",
"schema": {
"attributes": [
{
Expand Down Expand Up @@ -893,6 +937,12 @@
]
}
},
{
"name": "ops.quantized.linear",
"schema": {
"category": "Layer"
}
},
{
"name": "torch.max_pool2d",
"schema": {
Expand Down
Loading

0 comments on commit 6074cc9

Please sign in to comment.