Skip to content

Commit

Permalink
Update python.js (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Oct 16, 2024
1 parent b21850d commit bf43f6e
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit bf43f6e

Please sign in to comment.