(type, kind, range, vs)
| 6354 | return this.convertToList(type, kind, tok.range, vs); |
| 6355 | } |
| 6356 | convertToList(type, kind, range, vs) { |
| 6357 | switch (kind) { |
| 6358 | case torch._C.TypeKind.ComplexType: |
| 6359 | return new torch._C.IValue(new torch._C.List(torch.ComplexType.get(), vs.map((v) => v))); |
| 6360 | case torch._C.TypeKind.FloatType: |
| 6361 | return new torch._C.IValue(new torch._C.List(torch.FloatType.get(), vs.map((v) => v))); |
| 6362 | case torch._C.TypeKind.IntType: |
| 6363 | return new torch._C.IValue(new torch._C.List(torch.IntType.get(), vs.map((v) => v))); |
| 6364 | case torch._C.TypeKind.BoolType: |
| 6365 | return new torch._C.IValue(new torch._C.List(torch.BoolType.get(), vs.map((v) => v))); |
| 6366 | case torch._C.TypeKindDynamicType: |
| 6367 | return this.convertToList(type.dynamicKind(), range, vs); |
| 6368 | default: |
| 6369 | // throw(ErrorReport(range) << "lists are only supported for float, int and complex types"); |
| 6370 | throw new python.Error('lists are only supported for float, int and complex types'); |
| 6371 | } |
| 6372 | } |
| 6373 | }); |
| 6374 | this.registerType('torch.FunctionSchema', class { |
| 6375 | constructor(name, overload_name, args, returns, is_vararg, is_varret) { |
no test coverage detected