Skip to content

Commit

Permalink
Update PyTorch script
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Oct 19, 2024
1 parent 6a9b15d commit 369d595
Show file tree
Hide file tree
Showing 7 changed files with 2,469 additions and 1,857 deletions.
5 changes: 3 additions & 2 deletions source/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -6515,7 +6515,7 @@ python.Execution = class {
return list.join('');
}
});
this.registerType('torch._C.FunctionSchemaLexer', class {
this.registerType('torch._C.SchemaLexer', class {
constructor(buffer) {
this.buffer = buffer;
this.position = 0;
Expand Down Expand Up @@ -6991,7 +6991,7 @@ python.Execution = class {
}
_parse() {
if (this._buffer) {
const L = new torch._C.FunctionSchemaLexer(this._buffer);
const L = new torch._C.SchemaLexer(this._buffer);
this._arguments = [];
this._is_vararg = false;
this._kwarg_only = false;
Expand Down Expand Up @@ -7083,6 +7083,7 @@ python.Execution = class {
const returns = this.returns;
const braces = !this.is_varret &&
(returns.length !== 1 ||
returns[0].name ||
returns[0].real_type instanceof torch.TupleType ||
returns[0].real_type instanceof torch.ListType && returns[0].real_type.getElementType() instanceof torch.TupleType);
if (braces) {
Expand Down
Loading

0 comments on commit 369d595

Please sign in to comment.