MCPcopy Index your code
hub / github.com/lutzroeder/netron / getSliceInd

Method getSliceInd

source/python.js:17881–17887  ·  view source on GitHub ↗
(idx_val, loc)

Source from the content-addressed store, hash-verified

17879 return this.graph.insertNode(this.graph.createTupleIndex(tuple_val, idx_val, output_type)).output();
17880 }
17881 getSliceInd(idx_val, loc) {
17882 const ivalue = torch._C.toIValue(idx_val);
17883 if (ivalue && ivalue.isInt()) {
17884 return ivalue.toInt();
17885 }
17886 throw new python.Error(`Tuple slice indices must be integer constants at '${loc}'.`);
17887 }
17888 emitTupleSlice(loc, tuple_val, tuple_args) {
17889 const tuple_type = tuple_val.value(this.graph).type().expect(torch.TupleType);
17890 const tuple_len = tuple_type.elements().length;

Callers 1

emitTupleSliceMethod · 0.80

Calls 2

isIntMethod · 0.80
toIntMethod · 0.80

Tested by

no test coverage detected