| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- export const CNTK = {};
- CNTK.proto = {};
- CNTK.proto.NDShape = class NDShape {
- constructor() {
- this.shape_dim = [];
- }
- static decode(reader, length) {
- const message = new CNTK.proto.NDShape();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.shape_dim = reader.array(message.shape_dim, () => reader.uint64(), tag);
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.Axis = class Axis {
- static decode(reader, length) {
- const message = new CNTK.proto.Axis();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.static_axis_idx = reader.int32();
- break;
- case 2:
- message.name = reader.string();
- break;
- case 3:
- message.is_ordered_dynamic_axis = reader.bool();
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.Axis.prototype.static_axis_idx = 0;
- CNTK.proto.Axis.prototype.name = "";
- CNTK.proto.Axis.prototype.is_ordered_dynamic_axis = false;
- CNTK.proto.NDArrayView = class NDArrayView {
- get values() {
- CNTK.proto.NDArrayView.valuesSet = CNTK.proto.NDArrayView.valuesSet || new Set(["float_values", "double_values", "bytes_value", "sint32_values"]);
- return Object.keys(this).find((key) => CNTK.proto.NDArrayView.valuesSet.has(key) && this[key] !== null);
- }
- static decode(reader, length) {
- const message = new CNTK.proto.NDArrayView();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.data_type = reader.int32();
- break;
- case 2:
- message.storage_format = reader.int32();
- break;
- case 3:
- message.shape = CNTK.proto.NDShape.decode(reader, reader.uint32());
- break;
- case 4:
- message.float_values = CNTK.proto.NDArrayView.FloatValues.decode(reader, reader.uint32());
- break;
- case 5:
- message.double_values = CNTK.proto.NDArrayView.DoubleValues.decode(reader, reader.uint32());
- break;
- case 6:
- message.bytes_value = CNTK.proto.NDArrayView.BytesValue.decode(reader, reader.uint32());
- break;
- case 7:
- message.sint32_values = CNTK.proto.NDArrayView.IntValues.decode(reader, reader.uint32());
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.NDArrayView.prototype.data_type = 0;
- CNTK.proto.NDArrayView.prototype.storage_format = 0;
- CNTK.proto.NDArrayView.prototype.shape = null;
- CNTK.proto.NDArrayView.DataType = {
- "Unknown": 0,
- "Float": 1,
- "Double": 2,
- "Float16": 4,
- "Int8": 5,
- "Int16": 6
- };
- CNTK.proto.NDArrayView.StorageFormat = {
- "Dense": 0,
- "SparseCSC": 1,
- "SparseBlockCol": 2
- };
- CNTK.proto.NDArrayView.FloatValues = class FloatValues {
- constructor() {
- this.value = [];
- }
- static decode(reader, length) {
- const message = new CNTK.proto.NDArrayView.FloatValues();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.value = reader.floats(message.value, tag);
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.NDArrayView.DoubleValues = class DoubleValues {
- constructor() {
- this.value = [];
- }
- static decode(reader, length) {
- const message = new CNTK.proto.NDArrayView.DoubleValues();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.value = reader.doubles(message.value, tag);
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.NDArrayView.BytesValue = class BytesValue {
- static decode(reader, length) {
- const message = new CNTK.proto.NDArrayView.BytesValue();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.value = reader.bytes();
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.NDArrayView.BytesValue.prototype.value = new Uint8Array([]);
- CNTK.proto.NDArrayView.IntValues = class IntValues {
- constructor() {
- this.value = [];
- }
- static decode(reader, length) {
- const message = new CNTK.proto.NDArrayView.IntValues();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.value = reader.array(message.value, () => reader.sint32(), tag);
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.Vector = class Vector {
- constructor() {
- this.value = [];
- }
- static decode(reader, length) {
- const message = new CNTK.proto.Vector();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.value.push(CNTK.proto.DictionaryValue.decode(reader, reader.uint32()));
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.Dictionary = class Dictionary {
- constructor() {
- this.data = {};
- }
- static decode(reader, length) {
- const message = new CNTK.proto.Dictionary();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.version = reader.uint64();
- break;
- case 2:
- reader.entry(message.data, () => reader.string(), () => CNTK.proto.DictionaryValue.decode(reader, reader.uint32()));
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.Dictionary.prototype.version = 0n;
- CNTK.proto.DictionaryValue = class DictionaryValue {
- get value() {
- CNTK.proto.DictionaryValue.valueSet = CNTK.proto.DictionaryValue.valueSet || new Set(["bool_value", "int_value", "size_t_value", "float_value", "double_value", "string_value", "nd_shape_value", "axis_value", "vector_value", "dictionary_value", "nd_array_view_value"]);
- return Object.keys(this).find((key) => CNTK.proto.DictionaryValue.valueSet.has(key) && this[key] !== null);
- }
- static decode(reader, length) {
- const message = new CNTK.proto.DictionaryValue();
- const end = length === undefined ? reader.length : reader.position + length;
- while (reader.position < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- message.version = reader.uint64();
- break;
- case 2:
- message.value_type = reader.int32();
- break;
- case 3:
- message.bool_value = reader.bool();
- break;
- case 4:
- message.int_value = reader.int32();
- break;
- case 5:
- message.size_t_value = reader.uint64();
- break;
- case 6:
- message.float_value = reader.float();
- break;
- case 7:
- message.double_value = reader.double();
- break;
- case 8:
- message.string_value = reader.string();
- break;
- case 9:
- message.nd_shape_value = CNTK.proto.NDShape.decode(reader, reader.uint32());
- break;
- case 10:
- message.axis_value = CNTK.proto.Axis.decode(reader, reader.uint32());
- break;
- case 11:
- message.vector_value = CNTK.proto.Vector.decode(reader, reader.uint32());
- break;
- case 12:
- message.dictionary_value = CNTK.proto.Dictionary.decode(reader, reader.uint32());
- break;
- case 13:
- message.nd_array_view_value = CNTK.proto.NDArrayView.decode(reader, reader.uint32());
- break;
- default:
- reader.skipType(tag & 7);
- break;
- }
- }
- return message;
- }
- };
- CNTK.proto.DictionaryValue.prototype.version = 0n;
- CNTK.proto.DictionaryValue.prototype.value_type = 0;
- CNTK.proto.DictionaryValue.Type = {
- "None": 0,
- "Bool": 1,
- "Int": 2,
- "SizeT": 3,
- "Float": 4,
- "Double": 5,
- "String": 6,
- "NDShape": 7,
- "Axis": 8,
- "Vector": 9,
- "Dictionary": 10,
- "NDArrayView": 11
- };
|