Skip to content

Commit

Permalink
Update pytorch.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Oct 11, 2024
1 parent b21850d commit 5c7f3ee
Show file tree
Hide file tree
Showing 6 changed files with 3,857 additions and 1,561 deletions.
8 changes: 7 additions & 1 deletion source/python.js
Original file line number Diff line number Diff line change
Expand Up @@ -6163,7 +6163,7 @@ python.Execution = class {
});
this.registerType('torch.ClassType', class extends torch.Type {
constructor(qualified_name, cu, is_module) {
super();
super('ClassType');
this._qualified_name = qualified_name;
this._is_module = is_module;
this._attributes = new Map();
Expand Down Expand Up @@ -6247,6 +6247,9 @@ python.Execution = class {
elements() {
return this._elements;
}
__str__() {
return `Tuple[${this.elements().map((elem) => elem.toString()).join(', ')}]`;
}
});
this.registerType('torch.TensorType', class extends torch.Type {
constructor() {
Expand Down Expand Up @@ -6328,6 +6331,9 @@ python.Execution = class {
getValueType() {
return this._value;
}
__str__() {
return `Dict(${this.getKeyType().toString()}, ${this.getValueType().toString()})`;
}
});
this.registerType('torch.DeviceObjType', class extends torch.Type {
constructor() {
Expand Down
Loading

0 comments on commit 5c7f3ee

Please sign in to comment.