(v, size)
| 12248 | return n; |
| 12249 | } |
| 12250 | createListUnpack(v, size) { |
| 12251 | const list_type = v.type().expect(torch.ListType); |
| 12252 | const elem_type = list_type.getElementType(); |
| 12253 | const n = this.create('prim::ListUnpack', [v], 0); |
| 12254 | for (let i = 0; i < size; i++) { |
| 12255 | n.addOutput().setType(elem_type); |
| 12256 | } |
| 12257 | return n; |
| 12258 | } |
| 12259 | createTuple(values, tuple_type) { |
| 12260 | if (!tuple_type) { |
| 12261 | const types = values.map((v) => v.type()); |