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

Method emitBasicSlice

source/python.js:17948–17956  ·  view source on GitHub ↗
(loc, sliceable, subscript_exprs)

Source from the content-addressed store, hash-verified

17946 return this.emitSliceOp(loc, input, dim, start, end, step);
17947 }
17948 emitBasicSlice(loc, sliceable, subscript_exprs) {
17949 torch._C.AT_ASSERT(subscript_exprs instanceof ast.Slice);
17950 const slice_exp = subscript_exprs;
17951 let maybe_dim = null;
17952 if (sliceable.type().isSubtypeOf(torch.TensorType.get())) {
17953 maybe_dim = this.graph.insertConstant(0, loc);
17954 }
17955 return this.emitSlice(loc, sliceable, maybe_dim, slice_exp);
17956 }
17957 emitSubscript(subscript, type_hint) {
17958 type_hint = type_hint === undefined ? null : type_hint;
17959 const sv = this.emitSugaredExpr(subscript.value, 1);

Callers 1

emitSubscriptMethod · 0.80

Calls 5

isSubtypeOfMethod · 0.80
insertConstantMethod · 0.80
emitSliceMethod · 0.80
typeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected