MCPcopy
hub / github.com/lutzroeder/netron / createList

Method createList

source/python.js:12240–12249  ·  view source on GitHub ↗
(contained_type, values)

Source from the content-addressed store, hash-verified

12238 return n;
12239 }
12240 createList(contained_type, values) {
12241 const n = this.create('prim::ListConstruct', values);
12242 for (const v of values) {
12243 if (!v.type().isSubtypeOf(contained_type)) {
12244 throw new python.Error('Invalid list item.');
12245 }
12246 }
12247 n.output().setType(torch.ListType.create(contained_type));
12248 return n;
12249 }
12250 createListUnpack(v, size) {
12251 const list_type = v.type().expect(torch.ListType);
12252 const elem_type = list_type.getElementType();

Callers 2

constructorMethod · 0.80
emitListLiteralMethod · 0.80

Calls 5

isSubtypeOfMethod · 0.80
setTypeMethod · 0.80
createMethod · 0.45
typeMethod · 0.45
outputMethod · 0.45

Tested by

no test coverage detected