cntk-proto.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. var $root = protobuf.get('cntk');
  2. $root.CNTK = {};
  3. $root.CNTK.proto = {};
  4. $root.CNTK.proto.NDShape = class NDShape {
  5. constructor() {
  6. this.shape_dim = [];
  7. }
  8. static decode(reader, length) {
  9. const message = new $root.CNTK.proto.NDShape();
  10. const end = length !== undefined ? reader.position + length : reader.length;
  11. while (reader.position < end) {
  12. const tag = reader.uint32();
  13. switch (tag >>> 3) {
  14. case 1:
  15. message.shape_dim = reader.array(message.shape_dim, () => reader.uint64(), tag);
  16. break;
  17. default:
  18. reader.skipType(tag & 7);
  19. break;
  20. }
  21. }
  22. return message;
  23. }
  24. };
  25. $root.CNTK.proto.Axis = class Axis {
  26. constructor() {
  27. }
  28. static decode(reader, length) {
  29. const message = new $root.CNTK.proto.Axis();
  30. const end = length !== undefined ? reader.position + length : reader.length;
  31. while (reader.position < end) {
  32. const tag = reader.uint32();
  33. switch (tag >>> 3) {
  34. case 1:
  35. message.static_axis_idx = reader.int32();
  36. break;
  37. case 2:
  38. message.name = reader.string();
  39. break;
  40. case 3:
  41. message.is_ordered_dynamic_axis = reader.bool();
  42. break;
  43. default:
  44. reader.skipType(tag & 7);
  45. break;
  46. }
  47. }
  48. return message;
  49. }
  50. };
  51. $root.CNTK.proto.Axis.prototype.static_axis_idx = 0;
  52. $root.CNTK.proto.Axis.prototype.name = "";
  53. $root.CNTK.proto.Axis.prototype.is_ordered_dynamic_axis = false;
  54. $root.CNTK.proto.NDArrayView = class NDArrayView {
  55. constructor() {
  56. }
  57. get values() {
  58. $root.CNTK.proto.NDArrayView.valuesSet = $root.CNTK.proto.NDArrayView.valuesSet || new Set([ "float_values", "double_values", "bytes_value", "sint32_values"]);
  59. return Object.keys(this).find((key) => $root.CNTK.proto.NDArrayView.valuesSet.has(key) && this[key] != null);
  60. }
  61. static decode(reader, length) {
  62. const message = new $root.CNTK.proto.NDArrayView();
  63. const end = length !== undefined ? reader.position + length : reader.length;
  64. while (reader.position < end) {
  65. const tag = reader.uint32();
  66. switch (tag >>> 3) {
  67. case 1:
  68. message.data_type = reader.int32();
  69. break;
  70. case 2:
  71. message.storage_format = reader.int32();
  72. break;
  73. case 3:
  74. message.shape = $root.CNTK.proto.NDShape.decode(reader, reader.uint32());
  75. break;
  76. case 4:
  77. message.float_values = $root.CNTK.proto.NDArrayView.FloatValues.decode(reader, reader.uint32());
  78. break;
  79. case 5:
  80. message.double_values = $root.CNTK.proto.NDArrayView.DoubleValues.decode(reader, reader.uint32());
  81. break;
  82. case 6:
  83. message.bytes_value = $root.CNTK.proto.NDArrayView.BytesValue.decode(reader, reader.uint32());
  84. break;
  85. case 7:
  86. message.sint32_values = $root.CNTK.proto.NDArrayView.IntValues.decode(reader, reader.uint32());
  87. break;
  88. default:
  89. reader.skipType(tag & 7);
  90. break;
  91. }
  92. }
  93. return message;
  94. }
  95. };
  96. $root.CNTK.proto.NDArrayView.prototype.data_type = 0;
  97. $root.CNTK.proto.NDArrayView.prototype.storage_format = 0;
  98. $root.CNTK.proto.NDArrayView.prototype.shape = null;
  99. $root.CNTK.proto.NDArrayView.DataType = {
  100. "Unknown": 0,
  101. "Float": 1,
  102. "Double": 2,
  103. "Float16": 4,
  104. "Int8": 5,
  105. "Int16": 6
  106. };
  107. $root.CNTK.proto.NDArrayView.StorageFormat = {
  108. "Dense": 0,
  109. "SparseCSC": 1,
  110. "SparseBlockCol": 2
  111. };
  112. $root.CNTK.proto.NDArrayView.FloatValues = class FloatValues {
  113. constructor() {
  114. this.value = [];
  115. }
  116. static decode(reader, length) {
  117. const message = new $root.CNTK.proto.NDArrayView.FloatValues();
  118. const end = length !== undefined ? reader.position + length : reader.length;
  119. while (reader.position < end) {
  120. const tag = reader.uint32();
  121. switch (tag >>> 3) {
  122. case 1:
  123. message.value = reader.floats(message.value, tag);
  124. break;
  125. default:
  126. reader.skipType(tag & 7);
  127. break;
  128. }
  129. }
  130. return message;
  131. }
  132. };
  133. $root.CNTK.proto.NDArrayView.DoubleValues = class DoubleValues {
  134. constructor() {
  135. this.value = [];
  136. }
  137. static decode(reader, length) {
  138. const message = new $root.CNTK.proto.NDArrayView.DoubleValues();
  139. const end = length !== undefined ? reader.position + length : reader.length;
  140. while (reader.position < end) {
  141. const tag = reader.uint32();
  142. switch (tag >>> 3) {
  143. case 1:
  144. message.value = reader.doubles(message.value, tag);
  145. break;
  146. default:
  147. reader.skipType(tag & 7);
  148. break;
  149. }
  150. }
  151. return message;
  152. }
  153. };
  154. $root.CNTK.proto.NDArrayView.BytesValue = class BytesValue {
  155. constructor() {
  156. }
  157. static decode(reader, length) {
  158. const message = new $root.CNTK.proto.NDArrayView.BytesValue();
  159. const end = length !== undefined ? reader.position + length : reader.length;
  160. while (reader.position < end) {
  161. const tag = reader.uint32();
  162. switch (tag >>> 3) {
  163. case 1:
  164. message.value = reader.bytes();
  165. break;
  166. default:
  167. reader.skipType(tag & 7);
  168. break;
  169. }
  170. }
  171. return message;
  172. }
  173. };
  174. $root.CNTK.proto.NDArrayView.BytesValue.prototype.value = new Uint8Array([]);
  175. $root.CNTK.proto.NDArrayView.IntValues = class IntValues {
  176. constructor() {
  177. this.value = [];
  178. }
  179. static decode(reader, length) {
  180. const message = new $root.CNTK.proto.NDArrayView.IntValues();
  181. const end = length !== undefined ? reader.position + length : reader.length;
  182. while (reader.position < end) {
  183. const tag = reader.uint32();
  184. switch (tag >>> 3) {
  185. case 1:
  186. message.value = reader.array(message.value, () => reader.sint32(), tag);
  187. break;
  188. default:
  189. reader.skipType(tag & 7);
  190. break;
  191. }
  192. }
  193. return message;
  194. }
  195. };
  196. $root.CNTK.proto.Vector = class Vector {
  197. constructor() {
  198. this.value = [];
  199. }
  200. static decode(reader, length) {
  201. const message = new $root.CNTK.proto.Vector();
  202. const end = length !== undefined ? reader.position + length : reader.length;
  203. while (reader.position < end) {
  204. const tag = reader.uint32();
  205. switch (tag >>> 3) {
  206. case 1:
  207. message.value.push($root.CNTK.proto.DictionaryValue.decode(reader, reader.uint32()));
  208. break;
  209. default:
  210. reader.skipType(tag & 7);
  211. break;
  212. }
  213. }
  214. return message;
  215. }
  216. };
  217. $root.CNTK.proto.Dictionary = class Dictionary {
  218. constructor() {
  219. this.data = {};
  220. }
  221. static decode(reader, length) {
  222. const message = new $root.CNTK.proto.Dictionary();
  223. const end = length !== undefined ? reader.position + length : reader.length;
  224. while (reader.position < end) {
  225. const tag = reader.uint32();
  226. switch (tag >>> 3) {
  227. case 1:
  228. message.version = reader.uint64();
  229. break;
  230. case 2:
  231. reader.entry(message.data, () => reader.string(), () => $root.CNTK.proto.DictionaryValue.decode(reader, reader.uint32()));
  232. break;
  233. default:
  234. reader.skipType(tag & 7);
  235. break;
  236. }
  237. }
  238. return message;
  239. }
  240. };
  241. $root.CNTK.proto.Dictionary.prototype.version = protobuf.Uint64.create(0);
  242. $root.CNTK.proto.DictionaryValue = class DictionaryValue {
  243. constructor() {
  244. }
  245. get value() {
  246. $root.CNTK.proto.DictionaryValue.valueSet = $root.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"]);
  247. return Object.keys(this).find((key) => $root.CNTK.proto.DictionaryValue.valueSet.has(key) && this[key] != null);
  248. }
  249. static decode(reader, length) {
  250. const message = new $root.CNTK.proto.DictionaryValue();
  251. const end = length !== undefined ? reader.position + length : reader.length;
  252. while (reader.position < end) {
  253. const tag = reader.uint32();
  254. switch (tag >>> 3) {
  255. case 1:
  256. message.version = reader.uint64();
  257. break;
  258. case 2:
  259. message.value_type = reader.int32();
  260. break;
  261. case 3:
  262. message.bool_value = reader.bool();
  263. break;
  264. case 4:
  265. message.int_value = reader.int32();
  266. break;
  267. case 5:
  268. message.size_t_value = reader.uint64();
  269. break;
  270. case 6:
  271. message.float_value = reader.float();
  272. break;
  273. case 7:
  274. message.double_value = reader.double();
  275. break;
  276. case 8:
  277. message.string_value = reader.string();
  278. break;
  279. case 9:
  280. message.nd_shape_value = $root.CNTK.proto.NDShape.decode(reader, reader.uint32());
  281. break;
  282. case 10:
  283. message.axis_value = $root.CNTK.proto.Axis.decode(reader, reader.uint32());
  284. break;
  285. case 11:
  286. message.vector_value = $root.CNTK.proto.Vector.decode(reader, reader.uint32());
  287. break;
  288. case 12:
  289. message.dictionary_value = $root.CNTK.proto.Dictionary.decode(reader, reader.uint32());
  290. break;
  291. case 13:
  292. message.nd_array_view_value = $root.CNTK.proto.NDArrayView.decode(reader, reader.uint32());
  293. break;
  294. default:
  295. reader.skipType(tag & 7);
  296. break;
  297. }
  298. }
  299. return message;
  300. }
  301. };
  302. $root.CNTK.proto.DictionaryValue.prototype.version = protobuf.Uint64.create(0);
  303. $root.CNTK.proto.DictionaryValue.prototype.value_type = 0;
  304. $root.CNTK.proto.DictionaryValue.Type = {
  305. "None": 0,
  306. "Bool": 1,
  307. "Int": 2,
  308. "SizeT": 3,
  309. "Float": 4,
  310. "Double": 5,
  311. "String": 6,
  312. "NDShape": 7,
  313. "Axis": 8,
  314. "Vector": 9,
  315. "Dictionary": 10,
  316. "NDArrayView": 11
  317. };