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

Method deserialize_constant_input

source/python.js:20087–20100  ·  view source on GitHub ↗
(inp)

Source from the content-addressed store, hash-verified

20085 throw new python.Error(`Unknown input spec ${i}`);
20086 }
20087 deserialize_constant_input(inp) {
20088 if (inp.type === 'as_int') {
20089 return inp.as_int;
20090 } else if (inp.type === 'as_float') {
20091 return inp.as_float;
20092 } else if (inp.type === 'as_string') {
20093 return inp.as_string;
20094 } else if (inp.type === 'as_bool') {
20095 return inp.as_bool;
20096 } else if (inp.type === 'as_none') {
20097 return null;
20098 }
20099 throw new python.Error(`Unhandled constant argument ${inp} to deserialize.`);
20100 }
20101 deserialize_output_spec(o) {
20102 if (o.type === 'user_output') {
20103 return new torch.export.graph_signature.OutputSpec(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected