| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462 |
- export const executorch_flatbuffer = {};
- export const fb_xnnpack = {};
- export const vkgraph = {};
- executorch_flatbuffer.ScalarType = {
- BYTE: 0, '0': 'BYTE',
- CHAR: 1, '1': 'CHAR',
- SHORT: 2, '2': 'SHORT',
- INT: 3, '3': 'INT',
- LONG: 4, '4': 'LONG',
- HALF: 5, '5': 'HALF',
- FLOAT: 6, '6': 'FLOAT',
- DOUBLE: 7, '7': 'DOUBLE',
- BOOL: 11, '11': 'BOOL',
- QINT8: 12, '12': 'QINT8',
- QUINT8: 13, '13': 'QUINT8',
- QINT32: 14, '14': 'QINT32',
- BFLOAT16: 15, '15': 'BFLOAT16',
- QUINT4X2: 16, '16': 'QUINT4X2',
- QUINT2X4: 17, '17': 'QUINT2X4',
- BITS16: 22, '22': 'BITS16',
- FLOAT8E5M2: 23, '23': 'FLOAT8E5M2',
- FLOAT8E4M3FN: 24, '24': 'FLOAT8E4M3FN',
- FLOAT8E5M2FNUZ: 25, '25': 'FLOAT8E5M2FNUZ',
- FLOAT8E4M3FNUZ: 26, '26': 'FLOAT8E4M3FNUZ',
- UINT16: 27, '27': 'UINT16',
- UINT32: 28, '28': 'UINT32',
- UINT64: 29, '29': 'UINT64'
- };
- executorch_flatbuffer.ContainerMetadata = class ContainerMetadata {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.ContainerMetadata();
- $.encoded_inp_str = reader.string_(position, 4, null);
- $.encoded_out_str = reader.string_(position, 6, null);
- return $;
- }
- };
- executorch_flatbuffer.Null = class Null {
- static decode(/* reader, position */) {
- const $ = new executorch_flatbuffer.Null();
- return $;
- }
- };
- executorch_flatbuffer.AllocationDetails = class AllocationDetails {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.AllocationDetails();
- $.memory_id = reader.uint32_(position, 4, 0);
- $.memory_offset_low = reader.uint32_(position, 6, 0);
- $.memory_offset_high = reader.uint32_(position, 8, 0);
- return $;
- }
- };
- executorch_flatbuffer.TensorShapeDynamism = {
- STATIC: 0, '0': 'STATIC',
- DYNAMIC_BOUND: 1, '1': 'DYNAMIC_BOUND',
- DYNAMIC_UNBOUND: 2, '2': 'DYNAMIC_UNBOUND'
- };
- executorch_flatbuffer.TensorDataLocation = {
- SEGMENT: 0, '0': 'SEGMENT',
- EXTERNAL: 1, '1': 'EXTERNAL'
- };
- executorch_flatbuffer.ExtraTensorInfo = class ExtraTensorInfo {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.ExtraTensorInfo();
- $.mutable_data_segments_idx = reader.uint64_(position, 4, 0n);
- $.fully_qualified_name = reader.string_(position, 6, null);
- $.location = reader.int8_(position, 8, 0);
- return $;
- }
- };
- executorch_flatbuffer.Tensor = class Tensor {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Tensor();
- $.scalar_type = reader.int8_(position, 4, 0);
- $.storage_offset = reader.int32_(position, 6, 0);
- $.sizes = reader.array(position, 8, Int32Array);
- $.dim_order = reader.array(position, 10, Uint8Array);
- $.requires_grad = reader.bool_(position, 12, false);
- $.data_buffer_idx = reader.uint32_(position, 14, 0);
- $.allocation_info = reader.table(position, 16, executorch_flatbuffer.AllocationDetails);
- $.layout = reader.int8_(position, 18, 0);
- $.shape_dynamism = reader.int8_(position, 20, 0);
- $.extra_tensor_info = reader.table(position, 22, executorch_flatbuffer.ExtraTensorInfo);
- return $;
- }
- };
- executorch_flatbuffer.Int = class Int {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Int();
- $.int_val = reader.int64_(position, 4, 0n);
- return $;
- }
- };
- executorch_flatbuffer.Bool = class Bool {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Bool();
- $.bool_val = reader.bool_(position, 4, false);
- return $;
- }
- };
- executorch_flatbuffer.Double = class Double {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Double();
- $.double_val = reader.float64_(position, 4, 0);
- return $;
- }
- };
- executorch_flatbuffer.String = class String {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.String();
- $.string_val = reader.string_(position, 4, null);
- return $;
- }
- };
- executorch_flatbuffer.IntList = class IntList {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.IntList();
- $.items = reader.int64s_(position, 4);
- return $;
- }
- };
- executorch_flatbuffer.DoubleList = class DoubleList {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.DoubleList();
- $.items = reader.array(position, 4, Float64Array);
- return $;
- }
- };
- executorch_flatbuffer.BoolList = class BoolList {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.BoolList();
- $.items = reader.bools_(position, 4);
- return $;
- }
- };
- executorch_flatbuffer.TensorList = class TensorList {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.TensorList();
- $.items = reader.array(position, 4, Int32Array);
- return $;
- }
- };
- executorch_flatbuffer.OptionalTensorList = class OptionalTensorList {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.OptionalTensorList();
- $.items = reader.array(position, 4, Int32Array);
- return $;
- }
- };
- executorch_flatbuffer.KernelTypes = class {
- static decode(reader, position, type) {
- switch (type) {
- case 1: return executorch_flatbuffer.Null.decode(reader, position);
- case 2: return executorch_flatbuffer.Int.decode(reader, position);
- case 3: return executorch_flatbuffer.Bool.decode(reader, position);
- case 4: return executorch_flatbuffer.Double.decode(reader, position);
- case 5: return executorch_flatbuffer.Tensor.decode(reader, position);
- case 6: return executorch_flatbuffer.String.decode(reader, position);
- case 7: return executorch_flatbuffer.IntList.decode(reader, position);
- case 8: return executorch_flatbuffer.DoubleList.decode(reader, position);
- case 9: return executorch_flatbuffer.BoolList.decode(reader, position);
- case 10: return executorch_flatbuffer.TensorList.decode(reader, position);
- case 11: return executorch_flatbuffer.OptionalTensorList.decode(reader, position);
- default: return undefined;
- }
- }
- };
- executorch_flatbuffer.EValue = class EValue {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.EValue();
- $.val = reader.union(position, 4, executorch_flatbuffer.KernelTypes);
- return $;
- }
- };
- executorch_flatbuffer.Operator = class Operator {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Operator();
- $.name = reader.string_(position, 4, null);
- $.overload = reader.string_(position, 6, null);
- return $;
- }
- };
- executorch_flatbuffer.KernelCall = class KernelCall {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.KernelCall();
- $.op_index = reader.int32_(position, 4, 0);
- $.args = reader.array(position, 6, Int32Array);
- return $;
- }
- };
- executorch_flatbuffer.DelegateCall = class DelegateCall {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.DelegateCall();
- $.delegate_index = reader.int32_(position, 4, 0);
- $.args = reader.array(position, 6, Int32Array);
- return $;
- }
- };
- executorch_flatbuffer.MoveCall = class MoveCall {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.MoveCall();
- $.move_from = reader.int32_(position, 4, 0);
- $.move_to = reader.int32_(position, 6, 0);
- return $;
- }
- };
- executorch_flatbuffer.JumpFalseCall = class JumpFalseCall {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.JumpFalseCall();
- $.cond_value_index = reader.int32_(position, 4, 0);
- $.destination_instruction = reader.int32_(position, 6, 0);
- return $;
- }
- };
- executorch_flatbuffer.FreeCall = class FreeCall {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.FreeCall();
- $.value_index = reader.int32_(position, 4, 0);
- return $;
- }
- };
- executorch_flatbuffer.InstructionArguments = class {
- static decode(reader, position, type) {
- switch (type) {
- case 1: return executorch_flatbuffer.KernelCall.decode(reader, position);
- case 2: return executorch_flatbuffer.DelegateCall.decode(reader, position);
- case 3: return executorch_flatbuffer.MoveCall.decode(reader, position);
- case 4: return executorch_flatbuffer.JumpFalseCall.decode(reader, position);
- case 5: return executorch_flatbuffer.FreeCall.decode(reader, position);
- default: return undefined;
- }
- }
- };
- executorch_flatbuffer.Instruction = class Instruction {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Instruction();
- $.instr_args = reader.union(position, 4, executorch_flatbuffer.InstructionArguments);
- return $;
- }
- };
- executorch_flatbuffer.Frame = class Frame {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Frame();
- $.filename = reader.string_(position, 4, null);
- $.lineno = reader.int32_(position, 6, 0);
- $.name = reader.string_(position, 8, null);
- $.context = reader.string_(position, 10, null);
- return $;
- }
- };
- executorch_flatbuffer.FrameList = class FrameList {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.FrameList();
- $.items = reader.tables(position, 4, executorch_flatbuffer.Frame);
- return $;
- }
- };
- executorch_flatbuffer.DataLocation = {
- INLINE: 0, '0': 'INLINE',
- SEGMENT: 1, '1': 'SEGMENT'
- };
- executorch_flatbuffer.BackendDelegateDataReference = class BackendDelegateDataReference {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.BackendDelegateDataReference();
- $.location = reader.int8_(position, 4, 0);
- $.index = reader.uint32_(position, 6, 0);
- return $;
- }
- };
- executorch_flatbuffer.CompileSpec = class CompileSpec {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.CompileSpec();
- $.key = reader.string_(position, 4, null);
- $.value = reader.array(position, 6, Uint8Array);
- return $;
- }
- };
- executorch_flatbuffer.BackendDelegate = class BackendDelegate {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.BackendDelegate();
- $.id = reader.string_(position, 4, null);
- $.processed = reader.table(position, 6, executorch_flatbuffer.BackendDelegateDataReference);
- $.compile_specs = reader.tables(position, 8, executorch_flatbuffer.CompileSpec);
- return $;
- }
- };
- executorch_flatbuffer.Chain = class Chain {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Chain();
- $.inputs = reader.array(position, 4, Int32Array);
- $.outputs = reader.array(position, 6, Int32Array);
- $.instructions = reader.tables(position, 8, executorch_flatbuffer.Instruction);
- $.stacktrace = reader.tables(position, 10, executorch_flatbuffer.FrameList);
- return $;
- }
- };
- executorch_flatbuffer.ExecutionPlan = class ExecutionPlan {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.ExecutionPlan();
- $.name = reader.string_(position, 4, null);
- $.container_meta_type = reader.table(position, 6, executorch_flatbuffer.ContainerMetadata);
- $.values = reader.tables(position, 8, executorch_flatbuffer.EValue);
- $.inputs = reader.array(position, 10, Int32Array);
- $.outputs = reader.array(position, 12, Int32Array);
- $.chains = reader.tables(position, 14, executorch_flatbuffer.Chain);
- $.operators = reader.tables(position, 16, executorch_flatbuffer.Operator);
- $.delegates = reader.tables(position, 18, executorch_flatbuffer.BackendDelegate);
- $.non_const_buffer_sizes = reader.int64s_(position, 20);
- return $;
- }
- };
- executorch_flatbuffer.Buffer = class Buffer {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Buffer();
- $.storage = reader.array(position, 4, Uint8Array);
- return $;
- }
- };
- executorch_flatbuffer.BackendDelegateInlineData = class BackendDelegateInlineData {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.BackendDelegateInlineData();
- $.data = reader.array(position, 4, Uint8Array);
- return $;
- }
- };
- executorch_flatbuffer.DataSegment = class DataSegment {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.DataSegment();
- $.offset = reader.uint64_(position, 4, 0n);
- $.size = reader.uint64_(position, 6, 0n);
- return $;
- }
- };
- executorch_flatbuffer.SubsegmentOffsets = class SubsegmentOffsets {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.SubsegmentOffsets();
- $.segment_index = reader.uint32_(position, 4, 0);
- $.offsets = reader.uint64s_(position, 6);
- return $;
- }
- };
- executorch_flatbuffer.NamedData = class NamedData {
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.NamedData();
- $.key = reader.string_(position, 4, null);
- $.segment_index = reader.uint32_(position, 6, 0);
- return $;
- }
- };
- executorch_flatbuffer.Program = class Program {
- static identifier(reader) {
- return reader.identifier === 'ET12';
- }
- static create(reader) {
- return executorch_flatbuffer.Program.decode(reader, reader.root);
- }
- static decode(reader, position) {
- const $ = new executorch_flatbuffer.Program();
- $.version = reader.uint32_(position, 4, 0);
- $.execution_plan = reader.tables(position, 6, executorch_flatbuffer.ExecutionPlan);
- $.constant_buffer = reader.tables(position, 8, executorch_flatbuffer.Buffer);
- $.backend_delegate_data = reader.tables(position, 10, executorch_flatbuffer.BackendDelegateInlineData);
- $.segments = reader.tables(position, 12, executorch_flatbuffer.DataSegment);
- $.constant_segment = reader.table(position, 14, executorch_flatbuffer.SubsegmentOffsets);
- $.mutable_data_segments = reader.tables(position, 16, executorch_flatbuffer.SubsegmentOffsets);
- $.named_data = reader.tables(position, 18, executorch_flatbuffer.NamedData);
- return $;
- }
- };
- fb_xnnpack.XNNDatatype = {
- xnn_datatype_invalid: 0, '0': 'xnn_datatype_invalid',
- xnn_datatype_fp32: 1, '1': 'xnn_datatype_fp32',
- xnn_datatype_fp16: 2, '2': 'xnn_datatype_fp16',
- xnn_datatype_qint8: 3, '3': 'xnn_datatype_qint8',
- xnn_datatype_quint8: 4, '4': 'xnn_datatype_quint8',
- xnn_datatype_qint32: 5, '5': 'xnn_datatype_qint32',
- xnn_datatype_qcint8: 6, '6': 'xnn_datatype_qcint8',
- xnn_datatype_qcint32: 7, '7': 'xnn_datatype_qcint32',
- xnn_datatype_qcint4: 8, '8': 'xnn_datatype_qcint4',
- xnn_datatype_qdint8: 9, '9': 'xnn_datatype_qdint8',
- xnn_datatype_qbint4: 10, '10': 'xnn_datatype_qbint4',
- xnn_datatype_qpint8: 11, '11': 'xnn_datatype_qpint8',
- xnn_datatype_int32: 12, '12': 'xnn_datatype_int32',
- xnn_datatype_pfp32: 13, '13': 'xnn_datatype_pfp32',
- xnn_datatype_bf16: 14, '14': 'xnn_datatype_bf16'
- };
- fb_xnnpack.XNNQuantParams = class {
- static decode(reader, position, type) {
- switch (type) {
- case 1: return fb_xnnpack.PerChannelQuant.decode(reader, position);
- case 2: return fb_xnnpack.PerTensorQuant.decode(reader, position);
- case 3: return fb_xnnpack.PerTokenDynamicQuant.decode(reader, position);
- case 4: return fb_xnnpack.PerChannelGroupQuant.decode(reader, position);
- default: return undefined;
- }
- }
- };
- fb_xnnpack.Buffer = class Buffer {
- static decode(reader, position) {
- const $ = new fb_xnnpack.Buffer();
- $.storage = reader.array(position, 4, Uint8Array);
- return $;
- }
- };
- fb_xnnpack.PerChannelGroupQuant = class PerChannelGroupQuant {
- static decode(reader, position) {
- const $ = new fb_xnnpack.PerChannelGroupQuant();
- $.scale = reader.array(position, 4, Float32Array);
- $.channel_dim = reader.int32_(position, 6, 0);
- $.group_size = reader.int32_(position, 8, 0);
- $.scale_bf16 = reader.array(position, 10, Uint16Array);
- $.scale_buffer_idx = reader.uint32_(position, 12, 0);
- $.num_scales = reader.uint32_(position, 14, 0);
- return $;
- }
- };
- fb_xnnpack.PerChannelQuant = class PerChannelQuant {
- static decode(reader, position) {
- const $ = new fb_xnnpack.PerChannelQuant();
- $.scale = reader.array(position, 4, Float32Array);
- $.channel_dim = reader.int32_(position, 6, 0);
- $.scale_buffer_idx = reader.uint32_(position, 8, 0);
- $.num_scales = reader.uint32_(position, 10, 0);
- return $;
- }
- };
- fb_xnnpack.PerTokenDynamicQuant = class PerTokenDynamicQuant {
- static decode(reader, position) {
- const $ = new fb_xnnpack.PerTokenDynamicQuant();
- $.num_nonbatch_dims = reader.int32_(position, 4, 0);
- return $;
- }
- };
- fb_xnnpack.PerTensorQuant = class PerTensorQuant {
- static decode(reader, position) {
- const $ = new fb_xnnpack.PerTensorQuant();
- $.scale = reader.float32_(position, 4, 0);
- $.zero_point = reader.int32_(position, 6, 0);
- return $;
- }
- };
- fb_xnnpack.XNNTensorValue = class XNNTensorValue {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNTensorValue();
- $.datatype = reader.int16_(position, 4, 0);
- $.num_dims = reader.uint32_(position, 6, 0);
- $.dims = reader.array(position, 8, Uint32Array);
- $.constant_buffer_idx = reader.uint32_(position, 10, 0);
- $.external_id = reader.uint32_(position, 12, 0);
- $.flags = reader.uint32_(position, 14, 0);
- $.id_out = reader.uint32_(position, 16, 0);
- return $;
- }
- };
- fb_xnnpack.XNNQuantizedTensorValue = class XNNQuantizedTensorValue {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNQuantizedTensorValue();
- $.tensor_value = reader.table(position, 4, fb_xnnpack.XNNTensorValue);
- $.quant_params = reader.union(position, 6, fb_xnnpack.XNNQuantParams);
- return $;
- }
- };
- fb_xnnpack.XNodeUnion = class {
- static decode(reader, position, type) {
- switch (type) {
- case 1: return fb_xnnpack.XNNAdd.decode(reader, position);
- case 2: return fb_xnnpack.XNNFullyConnected.decode(reader, position);
- case 3: return fb_xnnpack.XNNSoftmax.decode(reader, position);
- case 4: return fb_xnnpack.XNNSigmoid.decode(reader, position);
- case 5: return fb_xnnpack.XNNStaticTranspose.decode(reader, position);
- case 6: return fb_xnnpack.XNNClamp.decode(reader, position);
- case 7: return fb_xnnpack.XNNConv2d.decode(reader, position);
- case 8: return fb_xnnpack.XNNDiv.decode(reader, position);
- case 9: return fb_xnnpack.XNNStaticResizeBilinear2D.decode(reader, position);
- case 10: return fb_xnnpack.XNNStaticConstantPad.decode(reader, position);
- case 11: return fb_xnnpack.XNNAvgPooling2d.decode(reader, position);
- case 12: return fb_xnnpack.XNNMinimum.decode(reader, position);
- case 13: return fb_xnnpack.XNNDepthwiseConv2d.decode(reader, position);
- case 14: return fb_xnnpack.XNNMaxPooling2d.decode(reader, position);
- case 15: return fb_xnnpack.XNNMultiply.decode(reader, position);
- case 16: return fb_xnnpack.XNNSubtract.decode(reader, position);
- case 17: return fb_xnnpack.XNNFloor.decode(reader, position);
- case 18: return fb_xnnpack.XNNConvert.decode(reader, position);
- case 19: return fb_xnnpack.XNNGlobalAvgPooling2d.decode(reader, position);
- case 20: return fb_xnnpack.XNNStaticReshape.decode(reader, position);
- case 21: return fb_xnnpack.XNNArgMaxPooling2d.decode(reader, position);
- case 22: return fb_xnnpack.XNNSquareRoot.decode(reader, position);
- case 23: return fb_xnnpack.XNNCeiling.decode(reader, position);
- case 24: return fb_xnnpack.XNNHardswish.decode(reader, position);
- case 25: return fb_xnnpack.XNNLeakyReLU.decode(reader, position);
- case 26: return fb_xnnpack.XNNMaximum.decode(reader, position);
- case 27: return fb_xnnpack.XNNNegate.decode(reader, position);
- case 28: return fb_xnnpack.XNNSquare.decode(reader, position);
- case 29: return fb_xnnpack.XNNELU.decode(reader, position);
- case 30: return fb_xnnpack.XNNAbs.decode(reader, position);
- case 31: return fb_xnnpack.XNNPReLU.decode(reader, position);
- case 32: return fb_xnnpack.XNNConcatenate2.decode(reader, position);
- case 33: return fb_xnnpack.XNNConcatenate3.decode(reader, position);
- case 34: return fb_xnnpack.XNNConcatenate4.decode(reader, position);
- case 35: return fb_xnnpack.XNNStaticSlice.decode(reader, position);
- case 36: return fb_xnnpack.XNNScaledDotProductAttention.decode(reader, position);
- case 37: return fb_xnnpack.XNNBatchMatrixMultiply.decode(reader, position);
- case 38: return fb_xnnpack.XNNConcatenate5.decode(reader, position);
- case 39: return fb_xnnpack.XNNConvTranspose2d.decode(reader, position);
- case 40: return fb_xnnpack.XNNReciprocalSquareRoot.decode(reader, position);
- case 41: return fb_xnnpack.XNNLog.decode(reader, position);
- case 42: return fb_xnnpack.XNNGelu.decode(reader, position);
- case 43: return fb_xnnpack.XNNTanh.decode(reader, position);
- case 44: return fb_xnnpack.XNNExp.decode(reader, position);
- case 45: return fb_xnnpack.XNNSin.decode(reader, position);
- case 46: return fb_xnnpack.XNNCopy.decode(reader, position);
- case 47: return fb_xnnpack.XNNCos.decode(reader, position);
- default: return undefined;
- }
- }
- };
- fb_xnnpack.XValueUnion = class {
- static decode(reader, position, type) {
- switch (type) {
- case 1: return fb_xnnpack.XNNTensorValue.decode(reader, position);
- case 2: return fb_xnnpack.XNNQuantizedTensorValue.decode(reader, position);
- default: return undefined;
- }
- }
- };
- fb_xnnpack.OutputMinMax = class OutputMinMax {
- static decode(reader, position) {
- const $ = new fb_xnnpack.OutputMinMax();
- $.output_min = reader.float32_(position, 4, 0);
- $.output_max = reader.float32_(position, 6, 0);
- return $;
- }
- };
- fb_xnnpack.XNode = class XNode {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNode();
- $.xnode_union = reader.union(position, 4, fb_xnnpack.XNodeUnion);
- $.debug_handle = reader.uint32_(position, 8, 0);
- $.output_min_max = reader.table(position, 10, fb_xnnpack.OutputMinMax);
- return $;
- }
- };
- fb_xnnpack.XValue = class XValue {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XValue();
- $.xvalue_union = reader.union(position, 4, fb_xnnpack.XValueUnion);
- return $;
- }
- };
- fb_xnnpack.XNNStaticTranspose = class XNNStaticTranspose {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNStaticTranspose();
- $.num_dims = reader.uint32_(position, 4, 0);
- $.perm = reader.array(position, 6, Uint32Array);
- $.input_id = reader.uint32_(position, 8, 0);
- $.output_id = reader.uint32_(position, 10, 0);
- $.flags = reader.uint32_(position, 12, 0);
- return $;
- }
- };
- fb_xnnpack.XNNStaticResizeBilinear2D = class XNNStaticResizeBilinear2D {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNStaticResizeBilinear2D();
- $.new_height = reader.uint32_(position, 4, 0);
- $.new_width = reader.uint32_(position, 6, 0);
- $.input_id = reader.uint32_(position, 8, 0);
- $.output_id = reader.uint32_(position, 10, 0);
- $.flags = reader.uint32_(position, 12, 0);
- return $;
- }
- };
- fb_xnnpack.XNNStaticConstantPad = class XNNStaticConstantPad {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNStaticConstantPad();
- $.pre_paddings = reader.array(position, 4, Uint32Array);
- $.post_paddings = reader.array(position, 6, Uint32Array);
- $.padding_value = reader.float32_(position, 8, 0);
- $.input_id = reader.uint32_(position, 10, 0);
- $.output_id = reader.uint32_(position, 12, 0);
- $.flags = reader.uint32_(position, 14, 0);
- return $;
- }
- };
- fb_xnnpack._XNNNode2x1 = class _XNNNode2x1 {
- static decode(reader, position, $) {
- $ = $ || new fb_xnnpack._XNNNode2x1();
- $.input1_id = reader.uint32_(position, 4, 0);
- $.input2_id = reader.uint32_(position, 6, 0);
- $.output_id = reader.uint32_(position, 8, 0);
- $.flags = reader.uint32_(position, 10, 0);
- return $;
- }
- };
- fb_xnnpack._XNNNode1x1 = class _XNNNode1x1 {
- static decode(reader, position, $) {
- $ = $ || new fb_xnnpack._XNNNode1x1();
- $.input_id = reader.uint32_(position, 4, 0);
- $.output_id = reader.uint32_(position, 6, 0);
- $.flags = reader.uint32_(position, 8, 0);
- return $;
- }
- };
- fb_xnnpack._XNNCat = class _XNNCat {
- static decode(reader, position, $) {
- $ = $ || new fb_xnnpack._XNNCat();
- $.axis = reader.uint32_(position, 4, 0);
- $.input1_id = reader.uint32_(position, 6, 0);
- $.input2_id = reader.uint32_(position, 8, 0);
- $.input3_id = reader.uint32_(position, 10, 0);
- $.input4_id = reader.uint32_(position, 12, 0);
- $.output_id = reader.uint32_(position, 14, 0);
- $.flags = reader.uint32_(position, 16, 0);
- $.input5_id = reader.uint32_(position, 18, 0);
- return $;
- }
- };
- fb_xnnpack.XNNELU = class XNNELU {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNELU();
- $.alpha = reader.float32_(position, 4, 0);
- $.input_id = reader.uint32_(position, 6, 0);
- $.output_id = reader.uint32_(position, 8, 0);
- $.flags = reader.uint32_(position, 10, 0);
- return $;
- }
- };
- fb_xnnpack.XNNFullyConnected = class XNNFullyConnected {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNFullyConnected();
- $.input1_id = reader.uint32_(position, 4, 0);
- $.filter_id = reader.uint32_(position, 6, 0);
- $.bias_id = reader.uint32_(position, 8, 0);
- $.output_id = reader.uint32_(position, 10, 0);
- $.flags = reader.uint32_(position, 12, 0);
- return $;
- }
- };
- fb_xnnpack._XNNNodeConv = class _XNNNodeConv {
- static decode(reader, position, $) {
- $ = $ || new fb_xnnpack._XNNNodeConv();
- $.padding_top = reader.uint32_(position, 4, 0);
- $.padding_right = reader.uint32_(position, 6, 0);
- $.padding_bottom = reader.uint32_(position, 8, 0);
- $.padding_left = reader.uint32_(position, 10, 0);
- $.kernel_height = reader.uint32_(position, 12, 0);
- $.kernel_width = reader.uint32_(position, 14, 0);
- $.subsampling_height = reader.uint32_(position, 16, 0);
- $.subsampling_width = reader.uint32_(position, 18, 0);
- $.dilation_height = reader.uint32_(position, 20, 0);
- $.dilation_width = reader.uint32_(position, 22, 0);
- $.group_input_channels = reader.uint32_(position, 24, 0);
- $.group_output_channels = reader.uint32_(position, 26, 0);
- $.groups = reader.uint32_(position, 28, 0);
- $.adjustment_height = reader.uint32_(position, 30, 0);
- $.adjustment_width = reader.uint32_(position, 32, 0);
- $.input1_id = reader.uint32_(position, 34, 0);
- $.filter_id = reader.uint32_(position, 36, 0);
- $.bias_id = reader.uint32_(position, 38, 0);
- $.output_id = reader.uint32_(position, 40, 0);
- $.flags = reader.uint32_(position, 42, 0);
- return $;
- }
- };
- fb_xnnpack._XNNPooling2D = class _XNNPooling2D {
- static decode(reader, position, $) {
- $ = $ || new fb_xnnpack._XNNPooling2D();
- $.padding_top = reader.uint32_(position, 4, 0);
- $.padding_right = reader.uint32_(position, 6, 0);
- $.padding_bottom = reader.uint32_(position, 8, 0);
- $.padding_left = reader.uint32_(position, 10, 0);
- $.pooling_height = reader.uint32_(position, 12, 0);
- $.pooling_width = reader.uint32_(position, 14, 0);
- $.stride_height = reader.uint32_(position, 16, 0);
- $.stride_width = reader.uint32_(position, 18, 0);
- $.dilation_height = reader.uint32_(position, 20, 0);
- $.dilation_width = reader.uint32_(position, 22, 0);
- $.input_id = reader.uint32_(position, 24, 0);
- $.output_id = reader.uint32_(position, 26, 0);
- $.flags = reader.uint32_(position, 28, 0);
- return $;
- }
- };
- fb_xnnpack.XNNStaticReshape = class XNNStaticReshape {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNStaticReshape();
- $.num_dims = reader.uint32_(position, 4, 0);
- $.new_shape = reader.array(position, 6, Uint32Array);
- $.input_id = reader.uint32_(position, 8, 0);
- $.output_id = reader.uint32_(position, 10, 0);
- $.flags = reader.uint32_(position, 12, 0);
- return $;
- }
- };
- fb_xnnpack.XNNStaticSlice = class XNNStaticSlice {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNStaticSlice();
- $.num_dims = reader.uint32_(position, 4, 0);
- $.offsets = reader.array(position, 6, Uint32Array);
- $.sizes = reader.array(position, 8, Uint32Array);
- $.input_id = reader.uint32_(position, 10, 0);
- $.output_id = reader.uint32_(position, 12, 0);
- $.flags = reader.uint32_(position, 14, 0);
- return $;
- }
- };
- fb_xnnpack.XNNScaledDotProductAttention = class XNNScaledDotProductAttention {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNScaledDotProductAttention();
- $.query_id = reader.uint32_(position, 4, 0);
- $.key_id = reader.uint32_(position, 6, 0);
- $.value_id = reader.uint32_(position, 8, 0);
- $.scale_id = reader.uint32_(position, 10, 0);
- $.mask_id = reader.uint32_(position, 12, 0);
- $.output_id = reader.uint32_(position, 14, 0);
- $.flags = reader.uint32_(position, 16, 0);
- return $;
- }
- };
- fb_xnnpack.XNNArgMaxPooling2d = class XNNArgMaxPooling2d {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNArgMaxPooling2d();
- $.padding_top = reader.uint32_(position, 4, 0);
- $.padding_right = reader.uint32_(position, 6, 0);
- $.padding_bottom = reader.uint32_(position, 8, 0);
- $.padding_left = reader.uint32_(position, 10, 0);
- $.pooling_height = reader.uint32_(position, 12, 0);
- $.pooling_width = reader.uint32_(position, 14, 0);
- $.input_id = reader.uint32_(position, 16, 0);
- $.output_value_id = reader.uint32_(position, 18, 0);
- $.output_index_id = reader.uint32_(position, 20, 0);
- $.flags = reader.uint32_(position, 22, 0);
- return $;
- }
- };
- fb_xnnpack.XNNLeakyReLU = class XNNLeakyReLU {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNLeakyReLU();
- $.negative_slope = reader.float32_(position, 4, 0);
- $.input_id = reader.uint32_(position, 6, 0);
- $.output_id = reader.uint32_(position, 8, 0);
- $.flags = reader.uint32_(position, 10, 0);
- return $;
- }
- };
- fb_xnnpack.ConstantDataOffset = class ConstantDataOffset {
- static decode(reader, position) {
- const $ = new fb_xnnpack.ConstantDataOffset();
- $.offset = reader.uint64_(position, 4, 0n);
- $.size = reader.uint64_(position, 6, 0n);
- $.named_key = reader.string_(position, 8, null);
- return $;
- }
- };
- fb_xnnpack.XNNGraph = class XNNGraph {
- static identifier(reader) {
- return reader.identifier === 'XN01';
- }
- static create(reader) {
- return fb_xnnpack.XNNGraph.decode(reader, reader.root);
- }
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNGraph();
- $.version = reader.string_(position, 4, null);
- $.xnodes = reader.tables(position, 6, fb_xnnpack.XNode);
- $.xvalues = reader.tables(position, 8, fb_xnnpack.XValue);
- $.num_externs = reader.uint32_(position, 10, 0);
- $.input_ids = reader.array(position, 12, Uint32Array);
- $.output_ids = reader.array(position, 14, Uint32Array);
- $.constant_buffer = reader.tables(position, 16, fb_xnnpack.Buffer);
- $.mem_buffer_sizes = reader.array(position, 18, Uint32Array);
- $.constant_data = reader.tables(position, 20, fb_xnnpack.ConstantDataOffset);
- return $;
- }
- };
- fb_xnnpack.XNNAdd = class XNNAdd {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNAdd();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNSoftmax = class XNNSoftmax {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNSoftmax();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNSigmoid = class XNNSigmoid {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNSigmoid();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNClamp = class XNNClamp {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNClamp();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNConv2d = class XNNConv2d {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNConv2d();
- fb_xnnpack._XNNNodeConv.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNDiv = class XNNDiv {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNDiv();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNAvgPooling2d = class XNNAvgPooling2d {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNAvgPooling2d();
- fb_xnnpack._XNNPooling2D.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNMinimum = class XNNMinimum {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNMinimum();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNDepthwiseConv2d = class XNNDepthwiseConv2d {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNDepthwiseConv2d();
- fb_xnnpack._XNNNodeConv.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNMaxPooling2d = class XNNMaxPooling2d {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNMaxPooling2d();
- fb_xnnpack._XNNPooling2D.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNMultiply = class XNNMultiply {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNMultiply();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNSubtract = class XNNSubtract {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNSubtract();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNFloor = class XNNFloor {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNFloor();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNConvert = class XNNConvert {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNConvert();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNGlobalAvgPooling2d = class XNNGlobalAvgPooling2d {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNGlobalAvgPooling2d();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNSquareRoot = class XNNSquareRoot {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNSquareRoot();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNCeiling = class XNNCeiling {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNCeiling();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNHardswish = class XNNHardswish {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNHardswish();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNMaximum = class XNNMaximum {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNMaximum();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNNegate = class XNNNegate {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNNegate();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNSquare = class XNNSquare {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNSquare();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNAbs = class XNNAbs {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNAbs();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNPReLU = class XNNPReLU {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNPReLU();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNConcatenate2 = class XNNConcatenate2 {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNConcatenate2();
- fb_xnnpack._XNNCat.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNConcatenate3 = class XNNConcatenate3 {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNConcatenate3();
- fb_xnnpack._XNNCat.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNConcatenate4 = class XNNConcatenate4 {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNConcatenate4();
- fb_xnnpack._XNNCat.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNBatchMatrixMultiply = class XNNBatchMatrixMultiply {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNBatchMatrixMultiply();
- fb_xnnpack._XNNNode2x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNConcatenate5 = class XNNConcatenate5 {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNConcatenate5();
- fb_xnnpack._XNNCat.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNConvTranspose2d = class XNNConvTranspose2d {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNConvTranspose2d();
- fb_xnnpack._XNNNodeConv.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNReciprocalSquareRoot = class XNNReciprocalSquareRoot {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNReciprocalSquareRoot();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNLog = class XNNLog {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNLog();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNGelu = class XNNGelu {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNGelu();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNTanh = class XNNTanh {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNTanh();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNExp = class XNNExp {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNExp();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNSin = class XNNSin {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNSin();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNCopy = class XNNCopy {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNCopy();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- fb_xnnpack.XNNCos = class XNNCos {
- static decode(reader, position) {
- const $ = new fb_xnnpack.XNNCos();
- fb_xnnpack._XNNNode1x1.decode(reader, position, $);
- return $;
- }
- };
- vkgraph.OperatorCall = class OperatorCall {
- static decode(reader, position) {
- const $ = new vkgraph.OperatorCall();
- $.node_id = reader.uint32_(position, 4, 0);
- $.name = reader.string_(position, 6, null);
- $.args = reader.array(position, 8, Int32Array);
- return $;
- }
- };
- vkgraph.VkDataType = {
- BOOL: 0, '0': 'BOOL',
- UINT8: 1, '1': 'UINT8',
- INT8: 2, '2': 'INT8',
- INT32: 3, '3': 'INT32',
- FLOAT16: 4, '4': 'FLOAT16',
- FLOAT32: 5, '5': 'FLOAT32',
- FLOAT64: 6, '6': 'FLOAT64',
- INT64: 7, '7': 'INT64',
- UNSET: 127, '127': 'UNSET'
- };
- vkgraph.VkStorageType = {
- BUFFER: 0, '0': 'BUFFER',
- TEXTURE_3D: 1, '1': 'TEXTURE_3D',
- TEXTURE_2D: 2, '2': 'TEXTURE_2D',
- DEFAULT_STORAGE: 255, '255': 'DEFAULT_STORAGE'
- };
- vkgraph.VkMemoryLayout = {
- TENSOR_WIDTH_PACKED: 0, '0': 'TENSOR_WIDTH_PACKED',
- TENSOR_HEIGHT_PACKED: 1, '1': 'TENSOR_HEIGHT_PACKED',
- TENSOR_CHANNELS_PACKED: 2, '2': 'TENSOR_CHANNELS_PACKED',
- PACKED_INT8_4W4C: 3, '3': 'PACKED_INT8_4W4C',
- PACKED_INT8_4H4W: 4, '4': 'PACKED_INT8_4H4W',
- PACKED_INT8_4W: 5, '5': 'PACKED_INT8_4W',
- PACKED_INT8_4C1W: 8, '8': 'PACKED_INT8_4C1W',
- DEFAULT_LAYOUT: 255, '255': 'DEFAULT_LAYOUT'
- };
- vkgraph.VkTensor = class VkTensor {
- static decode(reader, position) {
- const $ = new vkgraph.VkTensor();
- $.datatype = reader.int8_(position, 4, 0);
- $.dims = reader.array(position, 6, Uint32Array);
- $.constant_id = reader.int32_(position, 8, 0);
- $.mem_obj_id = reader.int32_(position, 10, 0);
- $.storage_type = reader.uint8_(position, 12, 255);
- $.memory_layout = reader.uint8_(position, 14, 255);
- $.staging_datatype = reader.int8_(position, 16, 127);
- return $;
- }
- };
- vkgraph.Null = class Null {
- static decode(/* reader, position */) {
- const $ = new vkgraph.Null();
- return $;
- }
- };
- vkgraph.Int = class Int {
- static decode(reader, position) {
- const $ = new vkgraph.Int();
- $.int_val = reader.int64_(position, 4, 0n);
- return $;
- }
- };
- vkgraph.Bool = class Bool {
- static decode(reader, position) {
- const $ = new vkgraph.Bool();
- $.bool_val = reader.bool_(position, 4, false);
- return $;
- }
- };
- vkgraph.Double = class Double {
- static decode(reader, position) {
- const $ = new vkgraph.Double();
- $.double_val = reader.float64_(position, 4, 0);
- return $;
- }
- };
- vkgraph.String = class String {
- static decode(reader, position) {
- const $ = new vkgraph.String();
- $.string_val = reader.string_(position, 4, null);
- return $;
- }
- };
- vkgraph.IntList = class IntList {
- static decode(reader, position) {
- const $ = new vkgraph.IntList();
- $.items = reader.int64s_(position, 4);
- return $;
- }
- };
- vkgraph.DoubleList = class DoubleList {
- static decode(reader, position) {
- const $ = new vkgraph.DoubleList();
- $.items = reader.array(position, 4, Float64Array);
- return $;
- }
- };
- vkgraph.BoolList = class BoolList {
- static decode(reader, position) {
- const $ = new vkgraph.BoolList();
- $.items = reader.bools_(position, 4);
- return $;
- }
- };
- vkgraph.ValueList = class ValueList {
- static decode(reader, position) {
- const $ = new vkgraph.ValueList();
- $.items = reader.array(position, 4, Int32Array);
- return $;
- }
- };
- vkgraph.SymInt = class SymInt {
- static decode(reader, position) {
- const $ = new vkgraph.SymInt();
- $.value = reader.int32_(position, 4, 0);
- return $;
- }
- };
- vkgraph.GraphTypes = class {
- static decode(reader, position, type) {
- switch (type) {
- case 1: return vkgraph.Null.decode(reader, position);
- case 2: return vkgraph.Int.decode(reader, position);
- case 3: return vkgraph.Double.decode(reader, position);
- case 4: return vkgraph.Bool.decode(reader, position);
- case 5: return vkgraph.VkTensor.decode(reader, position);
- case 6: return vkgraph.IntList.decode(reader, position);
- case 7: return vkgraph.DoubleList.decode(reader, position);
- case 8: return vkgraph.BoolList.decode(reader, position);
- case 9: return vkgraph.ValueList.decode(reader, position);
- case 10: return vkgraph.String.decode(reader, position);
- case 11: return vkgraph.SymInt.decode(reader, position);
- default: return undefined;
- }
- }
- };
- vkgraph.VkValue = class VkValue {
- static decode(reader, position) {
- const $ = new vkgraph.VkValue();
- $.value = reader.union(position, 4, vkgraph.GraphTypes);
- return $;
- }
- };
- vkgraph.VkBytes = class VkBytes {
- static decode(reader, position) {
- const $ = new vkgraph.VkBytes();
- $.offset = reader.uint64_(position, 4, 0n);
- $.length = reader.uint64_(position, 6, 0n);
- $.named_key = reader.string_(position, 8, null);
- return $;
- }
- };
- vkgraph.VkGraph = class VkGraph {
- static identifier(reader) {
- return reader.identifier === 'VK00';
- }
- static create(reader) {
- return vkgraph.VkGraph.decode(reader, reader.root);
- }
- static decode(reader, position) {
- const $ = new vkgraph.VkGraph();
- $.version = reader.string_(position, 4, null);
- $.chain = reader.tables(position, 6, vkgraph.OperatorCall);
- $.values = reader.tables(position, 8, vkgraph.VkValue);
- $.input_ids = reader.array(position, 10, Uint32Array);
- $.output_ids = reader.array(position, 12, Uint32Array);
- $.constants = reader.tables(position, 14, vkgraph.VkBytes);
- $.shaders = reader.tables(position, 16, vkgraph.VkBytes);
- $.storage_type_override = reader.uint8_(position, 18, 255);
- $.memory_layout_override = reader.uint8_(position, 20, 255);
- return $;
- }
- };
|