(tup, beg, step_size, num_values)
| 12279 | return n; |
| 12280 | } |
| 12281 | createTupleSlice(tup, beg, step_size, num_values) { |
| 12282 | const new_vals = []; |
| 12283 | const tt = tup.type().expect(torch.TupleType); |
| 12284 | let i = beg; |
| 12285 | for (let j = 0; j < num_values; j++) { |
| 12286 | const idx = this.insertConstant(new torch._C.IValue(i, 'Int')); |
| 12287 | const tupleIndex = this.insertNode(this.createTupleIndex(tup, idx, tt.elements()[i])); |
| 12288 | new_vals.push(tupleIndex.output()); |
| 12289 | i += step_size; |
| 12290 | } |
| 12291 | const n = this.createTuple(new_vals); |
| 12292 | return n; |
| 12293 | } |
| 12294 | createDict(key_type, value_type, keys, values) { |
| 12295 | if (keys.length !== values.length) { |
| 12296 | throw new python.Error('Invalid dictionary size.'); |
no test coverage detected