From 18696ec1bac1af21a6076455adb867e2dab81b29 Mon Sep 17 00:00:00 2001 From: Lutz Roeder Date: Sat, 12 Dec 2020 13:27:37 -0500 Subject: [PATCH] Update protoc.js --- source/bigdl-proto.js | 40 +- source/caffe-proto.js | 252 ++++----- source/caffe2-proto.js | 84 +-- source/cntk-proto.js | 40 +- source/coreml-proto.js | 1208 ++++++++++++++++++++-------------------- source/dnn-proto.js | 28 +- source/onnx-proto.js | 92 +-- source/paddle-proto.js | 76 +-- source/protobuf.js | 11 +- source/tf-proto.js | 364 ++++++------ source/uff-proto.js | 72 +-- source/view.js | 4 +- tools/protoc.js | 4 +- 13 files changed, 1134 insertions(+), 1141 deletions(-) diff --git a/source/bigdl-proto.js b/source/bigdl-proto.js index 2611f2880e..147129ef4e 100644 --- a/source/bigdl-proto.js +++ b/source/bigdl-proto.js @@ -25,8 +25,8 @@ $root.com.intel.analytics.bigdl.serialization.BigDLModule = class BigDLModule { static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.BigDLModule(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -172,8 +172,8 @@ $root.com.intel.analytics.bigdl.serialization.InitMethod = class InitMethod { static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.InitMethod(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -202,8 +202,8 @@ $root.com.intel.analytics.bigdl.serialization.BigDLTensor = class BigDLTensor { static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.BigDLTensor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -268,8 +268,8 @@ $root.com.intel.analytics.bigdl.serialization.TensorStorage = class TensorStorag static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.TensorStorage(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -319,8 +319,8 @@ $root.com.intel.analytics.bigdl.serialization.Regularizer = class Regularizer { static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.Regularizer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -374,8 +374,8 @@ $root.com.intel.analytics.bigdl.serialization.AttrValue = class AttrValue { static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.AttrValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -466,8 +466,8 @@ $root.com.intel.analytics.bigdl.serialization.AttrValue.ArrayValue = class Array static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.AttrValue.ArrayValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -541,8 +541,8 @@ $root.com.intel.analytics.bigdl.serialization.NameAttrList = class NameAttrList static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.NameAttrList(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -571,8 +571,8 @@ $root.com.intel.analytics.bigdl.serialization.Shape = class Shape { static decode(reader, length) { const message = new $root.com.intel.analytics.bigdl.serialization.Shape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -615,8 +615,8 @@ $root.google.protobuf.Any = class Any { static decode(reader, length) { const message = new $root.google.protobuf.Any(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/caffe-proto.js b/source/caffe-proto.js index 55a18ec2b3..85427c9b0d 100644 --- a/source/caffe-proto.js +++ b/source/caffe-proto.js @@ -10,8 +10,8 @@ $root.caffe.BlobShape = class BlobShape { static decode(reader, length) { const message = new $root.caffe.BlobShape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -54,8 +54,8 @@ $root.caffe.BlobProto = class BlobProto { static decode(reader, length) { const message = new $root.caffe.BlobProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 7: @@ -149,8 +149,8 @@ $root.caffe.BlobProtoVector = class BlobProtoVector { static decode(reader, length) { const message = new $root.caffe.BlobProtoVector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -190,8 +190,8 @@ $root.caffe.Datum = class Datum { static decode(reader, length) { const message = new $root.caffe.Datum(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -273,8 +273,8 @@ $root.caffe.FillerParameter = class FillerParameter { static decode(reader, length) { const message = new $root.caffe.FillerParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -375,8 +375,8 @@ $root.caffe.NetParameter = class NetParameter { static decode(reader, length) { const message = new $root.caffe.NetParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -474,8 +474,8 @@ $root.caffe.SolverParameter = class SolverParameter { static decode(reader, length) { const message = new $root.caffe.SolverParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 24: @@ -817,8 +817,8 @@ $root.caffe.SolverState = class SolverState { static decode(reader, length) { const message = new $root.caffe.SolverState(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -885,8 +885,8 @@ $root.caffe.NetState = class NetState { static decode(reader, length) { const message = new $root.caffe.NetState(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -942,8 +942,8 @@ $root.caffe.NetStateRule = class NetStateRule { static decode(reader, length) { const message = new $root.caffe.NetStateRule(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1010,8 +1010,8 @@ $root.caffe.ParamSpec = class ParamSpec { static decode(reader, length) { const message = new $root.caffe.ParamSpec(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1086,8 +1086,8 @@ $root.caffe.LayerParameter = class LayerParameter { static decode(reader, length) { const message = new $root.caffe.LayerParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1534,8 +1534,8 @@ $root.caffe.TransformationParameter = class TransformationParameter { static decode(reader, length) { const message = new $root.caffe.TransformationParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1617,8 +1617,8 @@ $root.caffe.LossParameter = class LossParameter { static decode(reader, length) { const message = new $root.caffe.LossParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1680,8 +1680,8 @@ $root.caffe.AccuracyParameter = class AccuracyParameter { static decode(reader, length) { const message = new $root.caffe.AccuracyParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1736,8 +1736,8 @@ $root.caffe.ArgMaxParameter = class ArgMaxParameter { static decode(reader, length) { const message = new $root.caffe.ArgMaxParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1792,8 +1792,8 @@ $root.caffe.ClipParameter = class ClipParameter { static decode(reader, length) { const message = new $root.caffe.ClipParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1841,8 +1841,8 @@ $root.caffe.ConcatParameter = class ConcatParameter { static decode(reader, length) { const message = new $root.caffe.ConcatParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -1890,8 +1890,8 @@ $root.caffe.BatchNormParameter = class BatchNormParameter { static decode(reader, length) { const message = new $root.caffe.BatchNormParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1946,8 +1946,8 @@ $root.caffe.BiasParameter = class BiasParameter { static decode(reader, length) { const message = new $root.caffe.BiasParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2002,8 +2002,8 @@ $root.caffe.ContrastiveLossParameter = class ContrastiveLossParameter { static decode(reader, length) { const message = new $root.caffe.ContrastiveLossParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2055,8 +2055,8 @@ $root.caffe.ConvolutionParameter = class ConvolutionParameter { static decode(reader, length) { const message = new $root.caffe.ConvolutionParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2219,8 +2219,8 @@ $root.caffe.CropParameter = class CropParameter { static decode(reader, length) { const message = new $root.caffe.CropParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2267,8 +2267,8 @@ $root.caffe.DataParameter = class DataParameter { static decode(reader, length) { const message = new $root.caffe.DataParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2377,8 +2377,8 @@ $root.caffe.DropoutParameter = class DropoutParameter { static decode(reader, length) { const message = new $root.caffe.DropoutParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2425,8 +2425,8 @@ $root.caffe.DummyDataParameter = class DummyDataParameter { static decode(reader, length) { const message = new $root.caffe.DummyDataParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2496,8 +2496,8 @@ $root.caffe.EltwiseParameter = class EltwiseParameter { static decode(reader, length) { const message = new $root.caffe.EltwiseParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2557,8 +2557,8 @@ $root.caffe.ELUParameter = class ELUParameter { static decode(reader, length) { const message = new $root.caffe.ELUParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2599,8 +2599,8 @@ $root.caffe.EmbedParameter = class EmbedParameter { static decode(reader, length) { const message = new $root.caffe.EmbedParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2669,8 +2669,8 @@ $root.caffe.ExpParameter = class ExpParameter { static decode(reader, length) { const message = new $root.caffe.ExpParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2725,8 +2725,8 @@ $root.caffe.FlattenParameter = class FlattenParameter { static decode(reader, length) { const message = new $root.caffe.FlattenParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2774,8 +2774,8 @@ $root.caffe.HDF5DataParameter = class HDF5DataParameter { static decode(reader, length) { const message = new $root.caffe.HDF5DataParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2830,8 +2830,8 @@ $root.caffe.HDF5OutputParameter = class HDF5OutputParameter { static decode(reader, length) { const message = new $root.caffe.HDF5OutputParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2872,8 +2872,8 @@ $root.caffe.HingeLossParameter = class HingeLossParameter { static decode(reader, length) { const message = new $root.caffe.HingeLossParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2919,8 +2919,8 @@ $root.caffe.ImageDataParameter = class ImageDataParameter { static decode(reader, length) { const message = new $root.caffe.ImageDataParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3038,8 +3038,8 @@ $root.caffe.InfogainLossParameter = class InfogainLossParameter { static decode(reader, length) { const message = new $root.caffe.InfogainLossParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3087,8 +3087,8 @@ $root.caffe.InnerProductParameter = class InnerProductParameter { static decode(reader, length) { const message = new $root.caffe.InnerProductParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3165,8 +3165,8 @@ $root.caffe.InputParameter = class InputParameter { static decode(reader, length) { const message = new $root.caffe.InputParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3205,8 +3205,8 @@ $root.caffe.LogParameter = class LogParameter { static decode(reader, length) { const message = new $root.caffe.LogParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3261,8 +3261,8 @@ $root.caffe.LRNParameter = class LRNParameter { static decode(reader, length) { const message = new $root.caffe.LRNParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3349,8 +3349,8 @@ $root.caffe.MemoryDataParameter = class MemoryDataParameter { static decode(reader, length) { const message = new $root.caffe.MemoryDataParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3412,8 +3412,8 @@ $root.caffe.MVNParameter = class MVNParameter { static decode(reader, length) { const message = new $root.caffe.MVNParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3468,8 +3468,8 @@ $root.caffe.ParameterParameter = class ParameterParameter { static decode(reader, length) { const message = new $root.caffe.ParameterParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3510,8 +3510,8 @@ $root.caffe.PoolingParameter = class PoolingParameter { static decode(reader, length) { const message = new $root.caffe.PoolingParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3653,8 +3653,8 @@ $root.caffe.PowerParameter = class PowerParameter { static decode(reader, length) { const message = new $root.caffe.PowerParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3709,8 +3709,8 @@ $root.caffe.PythonParameter = class PythonParameter { static decode(reader, length) { const message = new $root.caffe.PythonParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3772,8 +3772,8 @@ $root.caffe.RecurrentParameter = class RecurrentParameter { static decode(reader, length) { const message = new $root.caffe.RecurrentParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3842,8 +3842,8 @@ $root.caffe.ReductionParameter = class ReductionParameter { static decode(reader, length) { const message = new $root.caffe.ReductionParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3905,8 +3905,8 @@ $root.caffe.ReLUParameter = class ReLUParameter { static decode(reader, length) { const message = new $root.caffe.ReLUParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3960,8 +3960,8 @@ $root.caffe.ReshapeParameter = class ReshapeParameter { static decode(reader, length) { const message = new $root.caffe.ReshapeParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4016,8 +4016,8 @@ $root.caffe.ScaleParameter = class ScaleParameter { static decode(reader, length) { const message = new $root.caffe.ScaleParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4086,8 +4086,8 @@ $root.caffe.SigmoidParameter = class SigmoidParameter { static decode(reader, length) { const message = new $root.caffe.SigmoidParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4135,8 +4135,8 @@ $root.caffe.SliceParameter = class SliceParameter { static decode(reader, length) { const message = new $root.caffe.SliceParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: @@ -4190,8 +4190,8 @@ $root.caffe.SoftmaxParameter = class SoftmaxParameter { static decode(reader, length) { const message = new $root.caffe.SoftmaxParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4245,8 +4245,8 @@ $root.caffe.SwishParameter = class SwishParameter { static decode(reader, length) { const message = new $root.caffe.SwishParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4287,8 +4287,8 @@ $root.caffe.TanHParameter = class TanHParameter { static decode(reader, length) { const message = new $root.caffe.TanHParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4335,8 +4335,8 @@ $root.caffe.TileParameter = class TileParameter { static decode(reader, length) { const message = new $root.caffe.TileParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4384,8 +4384,8 @@ $root.caffe.ThresholdParameter = class ThresholdParameter { static decode(reader, length) { const message = new $root.caffe.ThresholdParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4426,8 +4426,8 @@ $root.caffe.WindowDataParameter = class WindowDataParameter { static decode(reader, length) { const message = new $root.caffe.WindowDataParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4552,8 +4552,8 @@ $root.caffe.SPPParameter = class SPPParameter { static decode(reader, length) { const message = new $root.caffe.SPPParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4630,8 +4630,8 @@ $root.caffe.V1LayerParameter = class V1LayerParameter { static decode(reader, length) { const message = new $root.caffe.V1LayerParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -5007,8 +5007,8 @@ $root.caffe.V0LayerParameter = class V0LayerParameter { static decode(reader, length) { const message = new $root.caffe.V0LayerParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5311,8 +5311,8 @@ $root.caffe.PReLUParameter = class PReLUParameter { static decode(reader, length) { const message = new $root.caffe.PReLUParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/caffe2-proto.js b/source/caffe2-proto.js index a69fb6cd91..bf590e6823 100644 --- a/source/caffe2-proto.js +++ b/source/caffe2-proto.js @@ -10,8 +10,8 @@ $root.caffe2.ExternalDataProto = class ExternalDataProto { static decode(reader, length) { const message = new $root.caffe2.ExternalDataProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -90,8 +90,8 @@ $root.caffe2.TensorProto = class TensorProto { static decode(reader, length) { const message = new $root.caffe2.TensorProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -241,8 +241,8 @@ $root.caffe2.TensorProto.Segment = class Segment { static decode(reader, length) { const message = new $root.caffe2.TensorProto.Segment(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -304,8 +304,8 @@ $root.caffe2.QTensorProto = class QTensorProto { static decode(reader, length) { const message = new $root.caffe2.QTensorProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -440,8 +440,8 @@ $root.caffe2.TensorProtos = class TensorProtos { static decode(reader, length) { const message = new $root.caffe2.TensorProtos(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -482,8 +482,8 @@ $root.caffe2.TensorShape = class TensorShape { static decode(reader, length) { const message = new $root.caffe2.TensorShape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -551,8 +551,8 @@ $root.caffe2.TensorShapes = class TensorShapes { static decode(reader, length) { const message = new $root.caffe2.TensorShapes(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -592,8 +592,8 @@ $root.caffe2.TensorBoundShape = class TensorBoundShape { static decode(reader, length) { const message = new $root.caffe2.TensorBoundShape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -665,8 +665,8 @@ $root.caffe2.TensorBoundShapes = class TensorBoundShapes { static decode(reader, length) { const message = new $root.caffe2.TensorBoundShapes(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -720,8 +720,8 @@ $root.caffe2.AOTConfig = class AOTConfig { static decode(reader, length) { const message = new $root.caffe2.AOTConfig(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -797,8 +797,8 @@ $root.caffe2.Argument = class Argument { static decode(reader, length) { const message = new $root.caffe2.Argument(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -925,8 +925,8 @@ $root.caffe2.DeviceOption = class DeviceOption { static decode(reader, length) { const message = new $root.caffe2.DeviceOption(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1005,8 +1005,8 @@ $root.caffe2.OperatorDef = class OperatorDef { static decode(reader, length) { const message = new $root.caffe2.OperatorDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1120,8 +1120,8 @@ $root.caffe2.MapFieldEntry = class MapFieldEntry { static decode(reader, length) { const message = new $root.caffe2.MapFieldEntry(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1180,8 +1180,8 @@ $root.caffe2.BackendOptions = class BackendOptions { static decode(reader, length) { const message = new $root.caffe2.BackendOptions(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1235,8 +1235,8 @@ $root.caffe2.PartitionInfo = class PartitionInfo { static decode(reader, length) { const message = new $root.caffe2.PartitionInfo(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1306,8 +1306,8 @@ $root.caffe2.NetDef = class NetDef { static decode(reader, length) { const message = new $root.caffe2.NetDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1401,8 +1401,8 @@ $root.caffe2.ExecutionStep = class ExecutionStep { static decode(reader, length) { const message = new $root.caffe2.ExecutionStep(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1527,8 +1527,8 @@ $root.caffe2.PlanDef = class PlanDef { static decode(reader, length) { const message = new $root.caffe2.PlanDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1581,8 +1581,8 @@ $root.caffe2.BlobProto = class BlobProto { static decode(reader, length) { const message = new $root.caffe2.BlobProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1665,8 +1665,8 @@ $root.caffe2.DBReaderProto = class DBReaderProto { static decode(reader, length) { const message = new $root.caffe2.DBReaderProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/cntk-proto.js b/source/cntk-proto.js index 3fac38f101..0e00424e0f 100644 --- a/source/cntk-proto.js +++ b/source/cntk-proto.js @@ -12,8 +12,8 @@ $root.CNTK.proto.NDShape = class NDShape { static decode(reader, length) { const message = new $root.CNTK.proto.NDShape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -35,8 +35,8 @@ $root.CNTK.proto.Axis = class Axis { static decode(reader, length) { const message = new $root.CNTK.proto.Axis(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -73,8 +73,8 @@ $root.CNTK.proto.NDArrayView = class NDArrayView { static decode(reader, length) { const message = new $root.CNTK.proto.NDArrayView(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -134,8 +134,8 @@ $root.CNTK.proto.NDArrayView.FloatValues = class FloatValues { static decode(reader, length) { const message = new $root.CNTK.proto.NDArrayView.FloatValues(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -158,8 +158,8 @@ $root.CNTK.proto.NDArrayView.DoubleValues = class DoubleValues { static decode(reader, length) { const message = new $root.CNTK.proto.NDArrayView.DoubleValues(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -181,8 +181,8 @@ $root.CNTK.proto.NDArrayView.BytesValue = class BytesValue { static decode(reader, length) { const message = new $root.CNTK.proto.NDArrayView.BytesValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -207,8 +207,8 @@ $root.CNTK.proto.NDArrayView.IntValues = class IntValues { static decode(reader, length) { const message = new $root.CNTK.proto.NDArrayView.IntValues(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -231,8 +231,8 @@ $root.CNTK.proto.Vector = class Vector { static decode(reader, length) { const message = new $root.CNTK.proto.Vector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -255,8 +255,8 @@ $root.CNTK.proto.Dictionary = class Dictionary { static decode(reader, length) { const message = new $root.CNTK.proto.Dictionary(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -288,8 +288,8 @@ $root.CNTK.proto.DictionaryValue = class DictionaryValue { static decode(reader, length) { const message = new $root.CNTK.proto.DictionaryValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/coreml-proto.js b/source/coreml-proto.js index 4891cf0a2c..25264926d0 100644 --- a/source/coreml-proto.js +++ b/source/coreml-proto.js @@ -13,8 +13,8 @@ $root.CoreML.Specification.Pipeline = class Pipeline { static decode(reader, length) { const message = new $root.CoreML.Specification.Pipeline(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -39,8 +39,8 @@ $root.CoreML.Specification.PipelineClassifier = class PipelineClassifier { static decode(reader, length) { const message = new $root.CoreML.Specification.PipelineClassifier(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -64,8 +64,8 @@ $root.CoreML.Specification.PipelineRegressor = class PipelineRegressor { static decode(reader, length) { const message = new $root.CoreML.Specification.PipelineRegressor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -89,8 +89,8 @@ $root.CoreML.Specification.FeatureDescription = class FeatureDescription { static decode(reader, length) { const message = new $root.CoreML.Specification.FeatureDescription(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -123,8 +123,8 @@ $root.CoreML.Specification.Metadata = class Metadata { static decode(reader, length) { const message = new $root.CoreML.Specification.Metadata(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -166,8 +166,8 @@ $root.CoreML.Specification.ModelDescription = class ModelDescription { static decode(reader, length) { const message = new $root.CoreML.Specification.ModelDescription(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -208,8 +208,8 @@ $root.CoreML.Specification.SerializedModel = class SerializedModel { static decode(reader, length) { const message = new $root.CoreML.Specification.SerializedModel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -242,8 +242,8 @@ $root.CoreML.Specification.Model = class Model { static decode(reader, length) { const message = new $root.CoreML.Specification.Model(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -384,8 +384,8 @@ $root.CoreML.Specification.CoreMLModels.VisionFeaturePrint = class VisionFeature static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.VisionFeaturePrint(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 20: @@ -410,8 +410,8 @@ $root.CoreML.Specification.CoreMLModels.VisionFeaturePrint.Scene = class Scene { static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.VisionFeaturePrint.Scene(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -441,8 +441,8 @@ $root.CoreML.Specification.CoreMLModels.VisionFeaturePrint.Objects = class Objec static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.VisionFeaturePrint.Objects(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -479,8 +479,8 @@ $root.CoreML.Specification.CoreMLModels.TextClassifier = class TextClassifier { static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.TextClassifier(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -520,8 +520,8 @@ $root.CoreML.Specification.CoreMLModels.WordTagger = class WordTagger { static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.WordTagger(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -577,8 +577,8 @@ $root.CoreML.Specification.CoreMLModels.Gazetteer = class Gazetteer { static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.Gazetteer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -613,8 +613,8 @@ $root.CoreML.Specification.CoreMLModels.WordEmbedding = class WordEmbedding { static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.WordEmbedding(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -651,8 +651,8 @@ $root.CoreML.Specification.CoreMLModels.SoundAnalysisPreprocessing = class Sound static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.SoundAnalysisPreprocessing(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 20: @@ -674,8 +674,8 @@ $root.CoreML.Specification.CoreMLModels.SoundAnalysisPreprocessing.Vggish = clas static decode(reader, length) { const message = new $root.CoreML.Specification.CoreMLModels.SoundAnalysisPreprocessing.Vggish(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -695,8 +695,8 @@ $root.CoreML.Specification.StringToInt64Map = class StringToInt64Map { static decode(reader, length) { const message = new $root.CoreML.Specification.StringToInt64Map(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -719,8 +719,8 @@ $root.CoreML.Specification.Int64ToStringMap = class Int64ToStringMap { static decode(reader, length) { const message = new $root.CoreML.Specification.Int64ToStringMap(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -743,8 +743,8 @@ $root.CoreML.Specification.StringToDoubleMap = class StringToDoubleMap { static decode(reader, length) { const message = new $root.CoreML.Specification.StringToDoubleMap(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -767,8 +767,8 @@ $root.CoreML.Specification.Int64ToDoubleMap = class Int64ToDoubleMap { static decode(reader, length) { const message = new $root.CoreML.Specification.Int64ToDoubleMap(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -791,8 +791,8 @@ $root.CoreML.Specification.StringVector = class StringVector { static decode(reader, length) { const message = new $root.CoreML.Specification.StringVector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -815,8 +815,8 @@ $root.CoreML.Specification.Int64Vector = class Int64Vector { static decode(reader, length) { const message = new $root.CoreML.Specification.Int64Vector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -839,8 +839,8 @@ $root.CoreML.Specification.FloatVector = class FloatVector { static decode(reader, length) { const message = new $root.CoreML.Specification.FloatVector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -863,8 +863,8 @@ $root.CoreML.Specification.DoubleVector = class DoubleVector { static decode(reader, length) { const message = new $root.CoreML.Specification.DoubleVector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -886,8 +886,8 @@ $root.CoreML.Specification.Int64Range = class Int64Range { static decode(reader, length) { const message = new $root.CoreML.Specification.Int64Range(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -916,8 +916,8 @@ $root.CoreML.Specification.Int64Set = class Int64Set { static decode(reader, length) { const message = new $root.CoreML.Specification.Int64Set(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -939,8 +939,8 @@ $root.CoreML.Specification.DoubleRange = class DoubleRange { static decode(reader, length) { const message = new $root.CoreML.Specification.DoubleRange(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -968,8 +968,8 @@ $root.CoreML.Specification.Int64FeatureType = class Int64FeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.Int64FeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -988,8 +988,8 @@ $root.CoreML.Specification.DoubleFeatureType = class DoubleFeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.DoubleFeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -1008,8 +1008,8 @@ $root.CoreML.Specification.StringFeatureType = class StringFeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.StringFeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -1028,8 +1028,8 @@ $root.CoreML.Specification.SizeRange = class SizeRange { static decode(reader, length) { const message = new $root.CoreML.Specification.SizeRange(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1062,8 +1062,8 @@ $root.CoreML.Specification.ImageFeatureType = class ImageFeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.ImageFeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1108,8 +1108,8 @@ $root.CoreML.Specification.ImageFeatureType.ImageSize = class ImageSize { static decode(reader, length) { const message = new $root.CoreML.Specification.ImageFeatureType.ImageSize(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1138,8 +1138,8 @@ $root.CoreML.Specification.ImageFeatureType.EnumeratedImageSizes = class Enumera static decode(reader, length) { const message = new $root.CoreML.Specification.ImageFeatureType.EnumeratedImageSizes(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1161,8 +1161,8 @@ $root.CoreML.Specification.ImageFeatureType.ImageSizeRange = class ImageSizeRang static decode(reader, length) { const message = new $root.CoreML.Specification.ImageFeatureType.ImageSizeRange(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1201,8 +1201,8 @@ $root.CoreML.Specification.ArrayFeatureType = class ArrayFeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.ArrayFeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1252,8 +1252,8 @@ $root.CoreML.Specification.ArrayFeatureType.Shape = class Shape { static decode(reader, length) { const message = new $root.CoreML.Specification.ArrayFeatureType.Shape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1276,8 +1276,8 @@ $root.CoreML.Specification.ArrayFeatureType.EnumeratedShapes = class EnumeratedS static decode(reader, length) { const message = new $root.CoreML.Specification.ArrayFeatureType.EnumeratedShapes(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1300,8 +1300,8 @@ $root.CoreML.Specification.ArrayFeatureType.ShapeRange = class ShapeRange { static decode(reader, length) { const message = new $root.CoreML.Specification.ArrayFeatureType.ShapeRange(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1328,8 +1328,8 @@ $root.CoreML.Specification.DictionaryFeatureType = class DictionaryFeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.DictionaryFeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1359,8 +1359,8 @@ $root.CoreML.Specification.SequenceFeatureType = class SequenceFeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.SequenceFeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1395,8 +1395,8 @@ $root.CoreML.Specification.FeatureType = class FeatureType { static decode(reader, length) { const message = new $root.CoreML.Specification.FeatureType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1442,8 +1442,8 @@ $root.CoreML.Specification.ArrayFeatureExtractor = class ArrayFeatureExtractor { static decode(reader, length) { const message = new $root.CoreML.Specification.ArrayFeatureExtractor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1466,8 +1466,8 @@ $root.CoreML.Specification.BayesianProbitRegressor = class BayesianProbitRegress static decode(reader, length) { const message = new $root.CoreML.Specification.BayesianProbitRegressor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1530,8 +1530,8 @@ $root.CoreML.Specification.BayesianProbitRegressor.Gaussian = class Gaussian { static decode(reader, length) { const message = new $root.CoreML.Specification.BayesianProbitRegressor.Gaussian(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1559,8 +1559,8 @@ $root.CoreML.Specification.BayesianProbitRegressor.FeatureValueWeight = class Fe static decode(reader, length) { const message = new $root.CoreML.Specification.BayesianProbitRegressor.FeatureValueWeight(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1589,8 +1589,8 @@ $root.CoreML.Specification.BayesianProbitRegressor.FeatureWeight = class Feature static decode(reader, length) { const message = new $root.CoreML.Specification.BayesianProbitRegressor.FeatureWeight(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1627,8 +1627,8 @@ $root.CoreML.Specification.CategoricalMapping = class CategoricalMapping { static decode(reader, length) { const message = new $root.CoreML.Specification.CategoricalMapping(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1660,8 +1660,8 @@ $root.CoreML.Specification.CustomModel = class CustomModel { static decode(reader, length) { const message = new $root.CoreML.Specification.CustomModel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -1697,8 +1697,8 @@ $root.CoreML.Specification.CustomModel.CustomModelParamValue = class CustomModel static decode(reader, length) { const message = new $root.CoreML.Specification.CustomModel.CustomModelParamValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -1740,8 +1740,8 @@ $root.CoreML.Specification.DictVectorizer = class DictVectorizer { static decode(reader, length) { const message = new $root.CoreML.Specification.DictVectorizer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1767,8 +1767,8 @@ $root.CoreML.Specification.FeatureVectorizer = class FeatureVectorizer { static decode(reader, length) { const message = new $root.CoreML.Specification.FeatureVectorizer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1790,8 +1790,8 @@ $root.CoreML.Specification.FeatureVectorizer.InputColumn = class InputColumn { static decode(reader, length) { const message = new $root.CoreML.Specification.FeatureVectorizer.InputColumn(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1821,8 +1821,8 @@ $root.CoreML.Specification.GLMRegressor = class GLMRegressor { static decode(reader, length) { const message = new $root.CoreML.Specification.GLMRegressor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1853,8 +1853,8 @@ $root.CoreML.Specification.GLMRegressor.DoubleArray = class DoubleArray { static decode(reader, length) { const message = new $root.CoreML.Specification.GLMRegressor.DoubleArray(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1889,8 +1889,8 @@ $root.CoreML.Specification.GLMClassifier = class GLMClassifier { static decode(reader, length) { const message = new $root.CoreML.Specification.GLMClassifier(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1931,8 +1931,8 @@ $root.CoreML.Specification.GLMClassifier.DoubleArray = class DoubleArray { static decode(reader, length) { const message = new $root.CoreML.Specification.GLMClassifier.DoubleArray(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1979,8 +1979,8 @@ $root.CoreML.Specification.KNearestNeighborsClassifier = class KNearestNeighbors static decode(reader, length) { const message = new $root.CoreML.Specification.KNearestNeighborsClassifier(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2037,8 +2037,8 @@ $root.CoreML.Specification.NearestNeighborsIndex = class NearestNeighborsIndex { static decode(reader, length) { const message = new $root.CoreML.Specification.NearestNeighborsIndex(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2074,8 +2074,8 @@ $root.CoreML.Specification.UniformWeighting = class UniformWeighting { static decode(reader, length) { const message = new $root.CoreML.Specification.UniformWeighting(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2094,8 +2094,8 @@ $root.CoreML.Specification.InverseDistanceWeighting = class InverseDistanceWeigh static decode(reader, length) { const message = new $root.CoreML.Specification.InverseDistanceWeighting(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2114,8 +2114,8 @@ $root.CoreML.Specification.LinearIndex = class LinearIndex { static decode(reader, length) { const message = new $root.CoreML.Specification.LinearIndex(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2134,8 +2134,8 @@ $root.CoreML.Specification.SingleKdTreeIndex = class SingleKdTreeIndex { static decode(reader, length) { const message = new $root.CoreML.Specification.SingleKdTreeIndex(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2159,8 +2159,8 @@ $root.CoreML.Specification.SquaredEuclideanDistance = class SquaredEuclideanDist static decode(reader, length) { const message = new $root.CoreML.Specification.SquaredEuclideanDistance(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2184,8 +2184,8 @@ $root.CoreML.Specification.Int64Parameter = class Int64Parameter { static decode(reader, length) { const message = new $root.CoreML.Specification.Int64Parameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2220,8 +2220,8 @@ $root.CoreML.Specification.DoubleParameter = class DoubleParameter { static decode(reader, length) { const message = new $root.CoreML.Specification.DoubleParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2248,8 +2248,8 @@ $root.CoreML.Specification.StringParameter = class StringParameter { static decode(reader, length) { const message = new $root.CoreML.Specification.StringParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2273,8 +2273,8 @@ $root.CoreML.Specification.BoolParameter = class BoolParameter { static decode(reader, length) { const message = new $root.CoreML.Specification.BoolParameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2298,8 +2298,8 @@ $root.CoreML.Specification.Identity = class Identity { static decode(reader, length) { const message = new $root.CoreML.Specification.Identity(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2328,8 +2328,8 @@ $root.CoreML.Specification.Imputer = class Imputer { static decode(reader, length) { const message = new $root.CoreML.Specification.Imputer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2390,8 +2390,8 @@ $root.CoreML.Specification.NeuralNetwork = class NeuralNetwork { static decode(reader, length) { const message = new $root.CoreML.Specification.NeuralNetwork(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2429,8 +2429,8 @@ $root.CoreML.Specification.NeuralNetworkImageScaler = class NeuralNetworkImageSc static decode(reader, length) { const message = new $root.CoreML.Specification.NeuralNetworkImageScaler(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -2471,8 +2471,8 @@ $root.CoreML.Specification.NeuralNetworkMeanImage = class NeuralNetworkMeanImage static decode(reader, length) { const message = new $root.CoreML.Specification.NeuralNetworkMeanImage(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2499,8 +2499,8 @@ $root.CoreML.Specification.NeuralNetworkPreprocessing = class NeuralNetworkPrepr static decode(reader, length) { const message = new $root.CoreML.Specification.NeuralNetworkPreprocessing(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2530,8 +2530,8 @@ $root.CoreML.Specification.ActivationReLU = class ActivationReLU { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationReLU(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2550,8 +2550,8 @@ $root.CoreML.Specification.ActivationLeakyReLU = class ActivationLeakyReLU { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationLeakyReLU(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2575,8 +2575,8 @@ $root.CoreML.Specification.ActivationTanh = class ActivationTanh { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationTanh(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2595,8 +2595,8 @@ $root.CoreML.Specification.ActivationScaledTanh = class ActivationScaledTanh { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationScaledTanh(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2624,8 +2624,8 @@ $root.CoreML.Specification.ActivationSigmoid = class ActivationSigmoid { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationSigmoid(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2644,8 +2644,8 @@ $root.CoreML.Specification.ActivationLinear = class ActivationLinear { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationLinear(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2673,8 +2673,8 @@ $root.CoreML.Specification.ActivationSigmoidHard = class ActivationSigmoidHard { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationSigmoidHard(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2702,8 +2702,8 @@ $root.CoreML.Specification.ActivationPReLU = class ActivationPReLU { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationPReLU(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2727,8 +2727,8 @@ $root.CoreML.Specification.ActivationELU = class ActivationELU { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationELU(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2752,8 +2752,8 @@ $root.CoreML.Specification.ActivationThresholdedReLU = class ActivationThreshold static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationThresholdedReLU(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2777,8 +2777,8 @@ $root.CoreML.Specification.ActivationSoftsign = class ActivationSoftsign { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationSoftsign(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2797,8 +2797,8 @@ $root.CoreML.Specification.ActivationSoftplus = class ActivationSoftplus { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationSoftplus(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -2817,8 +2817,8 @@ $root.CoreML.Specification.ActivationParametricSoftplus = class ActivationParame static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationParametricSoftplus(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2851,8 +2851,8 @@ $root.CoreML.Specification.ActivationParams = class ActivationParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ActivationParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 5: @@ -2911,8 +2911,8 @@ $root.CoreML.Specification.Tensor = class Tensor { static decode(reader, length) { const message = new $root.CoreML.Specification.Tensor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2948,8 +2948,8 @@ $root.CoreML.Specification.NeuralNetworkLayer = class NeuralNetworkLayer { static decode(reader, length) { const message = new $root.CoreML.Specification.NeuralNetworkLayer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3463,8 +3463,8 @@ $root.CoreML.Specification.BranchLayerParams = class BranchLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.BranchLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3492,8 +3492,8 @@ $root.CoreML.Specification.LoopLayerParams = class LoopLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LoopLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3529,8 +3529,8 @@ $root.CoreML.Specification.LoopBreakLayerParams = class LoopBreakLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LoopBreakLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3549,8 +3549,8 @@ $root.CoreML.Specification.LoopContinueLayerParams = class LoopContinueLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.LoopContinueLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3569,8 +3569,8 @@ $root.CoreML.Specification.CopyLayerParams = class CopyLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CopyLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3589,8 +3589,8 @@ $root.CoreML.Specification.GreaterThanLayerParams = class GreaterThanLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.GreaterThanLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -3614,8 +3614,8 @@ $root.CoreML.Specification.GreaterEqualLayerParams = class GreaterEqualLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.GreaterEqualLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -3639,8 +3639,8 @@ $root.CoreML.Specification.LessThanLayerParams = class LessThanLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LessThanLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -3664,8 +3664,8 @@ $root.CoreML.Specification.LessEqualLayerParams = class LessEqualLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LessEqualLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -3689,8 +3689,8 @@ $root.CoreML.Specification.EqualLayerParams = class EqualLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.EqualLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3714,8 +3714,8 @@ $root.CoreML.Specification.NotEqualLayerParams = class NotEqualLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.NotEqualLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3739,8 +3739,8 @@ $root.CoreML.Specification.LogicalAndLayerParams = class LogicalAndLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LogicalAndLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3759,8 +3759,8 @@ $root.CoreML.Specification.LogicalOrLayerParams = class LogicalOrLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LogicalOrLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3779,8 +3779,8 @@ $root.CoreML.Specification.LogicalXorLayerParams = class LogicalXorLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LogicalXorLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3799,8 +3799,8 @@ $root.CoreML.Specification.LogicalNotLayerParams = class LogicalNotLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LogicalNotLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3820,8 +3820,8 @@ $root.CoreML.Specification.BorderAmounts = class BorderAmounts { static decode(reader, length) { const message = new $root.CoreML.Specification.BorderAmounts(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -3843,8 +3843,8 @@ $root.CoreML.Specification.BorderAmounts.EdgeSizes = class EdgeSizes { static decode(reader, length) { const message = new $root.CoreML.Specification.BorderAmounts.EdgeSizes(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3872,8 +3872,8 @@ $root.CoreML.Specification.ValidPadding = class ValidPadding { static decode(reader, length) { const message = new $root.CoreML.Specification.ValidPadding(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3897,8 +3897,8 @@ $root.CoreML.Specification.SamePadding = class SamePadding { static decode(reader, length) { const message = new $root.CoreML.Specification.SamePadding(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3927,8 +3927,8 @@ $root.CoreML.Specification.SamplingMode = class SamplingMode { static decode(reader, length) { const message = new $root.CoreML.Specification.SamplingMode(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3959,8 +3959,8 @@ $root.CoreML.Specification.BoxCoordinatesMode = class BoxCoordinatesMode { static decode(reader, length) { const message = new $root.CoreML.Specification.BoxCoordinatesMode(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3992,8 +3992,8 @@ $root.CoreML.Specification.WeightParams = class WeightParams { static decode(reader, length) { const message = new $root.CoreML.Specification.WeightParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4041,8 +4041,8 @@ $root.CoreML.Specification.QuantizationParams = class QuantizationParams { static decode(reader, length) { const message = new $root.CoreML.Specification.QuantizationParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4074,8 +4074,8 @@ $root.CoreML.Specification.LinearQuantizationParams = class LinearQuantizationPa static decode(reader, length) { const message = new $root.CoreML.Specification.LinearQuantizationParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4101,8 +4101,8 @@ $root.CoreML.Specification.LookUpTableQuantizationParams = class LookUpTableQuan static decode(reader, length) { const message = new $root.CoreML.Specification.LookUpTableQuantizationParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4133,8 +4133,8 @@ $root.CoreML.Specification.ConvolutionLayerParams = class ConvolutionLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.ConvolutionLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4201,8 +4201,8 @@ $root.CoreML.Specification.Convolution3DLayerParams = class Convolution3DLayerPa static decode(reader, length) { const message = new $root.CoreML.Specification.Convolution3DLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4323,8 +4323,8 @@ $root.CoreML.Specification.InnerProductLayerParams = class InnerProductLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.InnerProductLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4368,8 +4368,8 @@ $root.CoreML.Specification.EmbeddingLayerParams = class EmbeddingLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.EmbeddingLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4409,8 +4409,8 @@ $root.CoreML.Specification.EmbeddingNDLayerParams = class EmbeddingNDLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.EmbeddingNDLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4450,8 +4450,8 @@ $root.CoreML.Specification.BatchnormLayerParams = class BatchnormLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.BatchnormLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4510,8 +4510,8 @@ $root.CoreML.Specification.PoolingLayerParams = class PoolingLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.PoolingLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4565,8 +4565,8 @@ $root.CoreML.Specification.PoolingLayerParams.ValidCompletePadding = class Valid static decode(reader, length) { const message = new $root.CoreML.Specification.PoolingLayerParams.ValidCompletePadding(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -4588,8 +4588,8 @@ $root.CoreML.Specification.Pooling3DLayerParams = class Pooling3DLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.Pooling3DLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4680,8 +4680,8 @@ $root.CoreML.Specification.GlobalPooling3DLayerParams = class GlobalPooling3DLay static decode(reader, length) { const message = new $root.CoreML.Specification.GlobalPooling3DLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4715,8 +4715,8 @@ $root.CoreML.Specification.PaddingLayerParams = class PaddingLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.PaddingLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4749,8 +4749,8 @@ $root.CoreML.Specification.PaddingLayerParams.PaddingConstant = class PaddingCon static decode(reader, length) { const message = new $root.CoreML.Specification.PaddingLayerParams.PaddingConstant(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4774,8 +4774,8 @@ $root.CoreML.Specification.PaddingLayerParams.PaddingReflection = class PaddingR static decode(reader, length) { const message = new $root.CoreML.Specification.PaddingLayerParams.PaddingReflection(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -4794,8 +4794,8 @@ $root.CoreML.Specification.PaddingLayerParams.PaddingReplication = class Padding static decode(reader, length) { const message = new $root.CoreML.Specification.PaddingLayerParams.PaddingReplication(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -4814,8 +4814,8 @@ $root.CoreML.Specification.ConcatLayerParams = class ConcatLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ConcatLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 100: @@ -4839,8 +4839,8 @@ $root.CoreML.Specification.LRNLayerParams = class LRNLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LRNLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4876,8 +4876,8 @@ $root.CoreML.Specification.SoftmaxLayerParams = class SoftmaxLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SoftmaxLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -4896,8 +4896,8 @@ $root.CoreML.Specification.SplitLayerParams = class SplitLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SplitLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4921,8 +4921,8 @@ $root.CoreML.Specification.AddLayerParams = class AddLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AddLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4946,8 +4946,8 @@ $root.CoreML.Specification.MultiplyLayerParams = class MultiplyLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.MultiplyLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4971,8 +4971,8 @@ $root.CoreML.Specification.UnaryFunctionLayerParams = class UnaryFunctionLayerPa static decode(reader, length) { const message = new $root.CoreML.Specification.UnaryFunctionLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5025,8 +5025,8 @@ $root.CoreML.Specification.UpsampleLayerParams = class UpsampleLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.UpsampleLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5072,8 +5072,8 @@ $root.CoreML.Specification.ResizeBilinearLayerParams = class ResizeBilinearLayer static decode(reader, length) { const message = new $root.CoreML.Specification.ResizeBilinearLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5101,8 +5101,8 @@ $root.CoreML.Specification.CropResizeLayerParams = class CropResizeLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CropResizeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5142,8 +5142,8 @@ $root.CoreML.Specification.BiasLayerParams = class BiasLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.BiasLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5172,8 +5172,8 @@ $root.CoreML.Specification.ScaleLayerParams = class ScaleLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ScaleLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5212,8 +5212,8 @@ $root.CoreML.Specification.LoadConstantLayerParams = class LoadConstantLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.LoadConstantLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5240,8 +5240,8 @@ $root.CoreML.Specification.L2NormalizeLayerParams = class L2NormalizeLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.L2NormalizeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5265,8 +5265,8 @@ $root.CoreML.Specification.FlattenLayerParams = class FlattenLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.FlattenLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5296,8 +5296,8 @@ $root.CoreML.Specification.ReshapeLayerParams = class ReshapeLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReshapeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5330,8 +5330,8 @@ $root.CoreML.Specification.PermuteLayerParams = class PermuteLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.PermuteLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5353,8 +5353,8 @@ $root.CoreML.Specification.ReorganizeDataLayerParams = class ReorganizeDataLayer static decode(reader, length) { const message = new $root.CoreML.Specification.ReorganizeDataLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5388,8 +5388,8 @@ $root.CoreML.Specification.SliceLayerParams = class SliceLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SliceLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5431,8 +5431,8 @@ $root.CoreML.Specification.ReduceLayerParams = class ReduceLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5486,8 +5486,8 @@ $root.CoreML.Specification.CropLayerParams = class CropLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CropLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5514,8 +5514,8 @@ $root.CoreML.Specification.AverageLayerParams = class AverageLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AverageLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -5534,8 +5534,8 @@ $root.CoreML.Specification.MaxLayerParams = class MaxLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.MaxLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -5554,8 +5554,8 @@ $root.CoreML.Specification.MinLayerParams = class MinLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.MinLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -5574,8 +5574,8 @@ $root.CoreML.Specification.DotProductLayerParams = class DotProductLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.DotProductLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5599,8 +5599,8 @@ $root.CoreML.Specification.MeanVarianceNormalizeLayerParams = class MeanVariance static decode(reader, length) { const message = new $root.CoreML.Specification.MeanVarianceNormalizeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5632,8 +5632,8 @@ $root.CoreML.Specification.SequenceRepeatLayerParams = class SequenceRepeatLayer static decode(reader, length) { const message = new $root.CoreML.Specification.SequenceRepeatLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5657,8 +5657,8 @@ $root.CoreML.Specification.SimpleRecurrentLayerParams = class SimpleRecurrentLay static decode(reader, length) { const message = new $root.CoreML.Specification.SimpleRecurrentLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5715,8 +5715,8 @@ $root.CoreML.Specification.GRULayerParams = class GRULayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.GRULayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5795,8 +5795,8 @@ $root.CoreML.Specification.LSTMParams = class LSTMParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LSTMParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -5840,8 +5840,8 @@ $root.CoreML.Specification.LSTMWeightParams = class LSTMWeightParams { static decode(reader, length) { const message = new $root.CoreML.Specification.LSTMWeightParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5922,8 +5922,8 @@ $root.CoreML.Specification.UniDirectionalLSTMLayerParams = class UniDirectionalL static decode(reader, length) { const message = new $root.CoreML.Specification.UniDirectionalLSTMLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5969,8 +5969,8 @@ $root.CoreML.Specification.BiDirectionalLSTMLayerParams = class BiDirectionalLST static decode(reader, length) { const message = new $root.CoreML.Specification.BiDirectionalLSTMLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6013,8 +6013,8 @@ $root.CoreML.Specification.CustomLayerParams = class CustomLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CustomLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -6053,8 +6053,8 @@ $root.CoreML.Specification.CustomLayerParams.CustomLayerParamValue = class Custo static decode(reader, length) { const message = new $root.CoreML.Specification.CustomLayerParams.CustomLayerParamValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -6089,8 +6089,8 @@ $root.CoreML.Specification.TransposeLayerParams = class TransposeLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.TransposeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6112,8 +6112,8 @@ $root.CoreML.Specification.BatchedMatMulLayerParams = class BatchedMatMulLayerPa static decode(reader, length) { const message = new $root.CoreML.Specification.BatchedMatMulLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6165,8 +6165,8 @@ $root.CoreML.Specification.ConcatNDLayerParams = class ConcatNDLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ConcatNDLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6194,8 +6194,8 @@ $root.CoreML.Specification.SoftmaxNDLayerParams = class SoftmaxNDLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SoftmaxNDLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6220,8 +6220,8 @@ $root.CoreML.Specification.ReverseLayerParams = class ReverseLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReverseLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6243,8 +6243,8 @@ $root.CoreML.Specification.ReverseSeqLayerParams = class ReverseSeqLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReverseSeqLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6273,8 +6273,8 @@ $root.CoreML.Specification.LoadConstantNDLayerParams = class LoadConstantNDLayer static decode(reader, length) { const message = new $root.CoreML.Specification.LoadConstantNDLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6301,8 +6301,8 @@ $root.CoreML.Specification.FillLikeLayerParams = class FillLikeLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.FillLikeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6327,8 +6327,8 @@ $root.CoreML.Specification.FillStaticLayerParams = class FillStaticLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.FillStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6355,8 +6355,8 @@ $root.CoreML.Specification.FillDynamicLayerParams = class FillDynamicLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.FillDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6380,8 +6380,8 @@ $root.CoreML.Specification.WhereBroadcastableLayerParams = class WhereBroadcasta static decode(reader, length) { const message = new $root.CoreML.Specification.WhereBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6400,8 +6400,8 @@ $root.CoreML.Specification.SinLayerParams = class SinLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SinLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6420,8 +6420,8 @@ $root.CoreML.Specification.CosLayerParams = class CosLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CosLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6440,8 +6440,8 @@ $root.CoreML.Specification.TanLayerParams = class TanLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.TanLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6460,8 +6460,8 @@ $root.CoreML.Specification.AsinLayerParams = class AsinLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AsinLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6480,8 +6480,8 @@ $root.CoreML.Specification.AcosLayerParams = class AcosLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AcosLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6500,8 +6500,8 @@ $root.CoreML.Specification.AtanLayerParams = class AtanLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AtanLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6520,8 +6520,8 @@ $root.CoreML.Specification.SinhLayerParams = class SinhLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SinhLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6540,8 +6540,8 @@ $root.CoreML.Specification.CoshLayerParams = class CoshLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CoshLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6560,8 +6560,8 @@ $root.CoreML.Specification.TanhLayerParams = class TanhLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.TanhLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6580,8 +6580,8 @@ $root.CoreML.Specification.AsinhLayerParams = class AsinhLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AsinhLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6600,8 +6600,8 @@ $root.CoreML.Specification.AcoshLayerParams = class AcoshLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AcoshLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6620,8 +6620,8 @@ $root.CoreML.Specification.AtanhLayerParams = class AtanhLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.AtanhLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6640,8 +6640,8 @@ $root.CoreML.Specification.PowBroadcastableLayerParams = class PowBroadcastableL static decode(reader, length) { const message = new $root.CoreML.Specification.PowBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6660,8 +6660,8 @@ $root.CoreML.Specification.Exp2LayerParams = class Exp2LayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.Exp2LayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6680,8 +6680,8 @@ $root.CoreML.Specification.WhereNonZeroLayerParams = class WhereNonZeroLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.WhereNonZeroLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6700,8 +6700,8 @@ $root.CoreML.Specification.MatrixBandPartLayerParams = class MatrixBandPartLayer static decode(reader, length) { const message = new $root.CoreML.Specification.MatrixBandPartLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6729,8 +6729,8 @@ $root.CoreML.Specification.UpperTriangularLayerParams = class UpperTriangularLay static decode(reader, length) { const message = new $root.CoreML.Specification.UpperTriangularLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6754,8 +6754,8 @@ $root.CoreML.Specification.LowerTriangularLayerParams = class LowerTriangularLay static decode(reader, length) { const message = new $root.CoreML.Specification.LowerTriangularLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6779,8 +6779,8 @@ $root.CoreML.Specification.BroadcastToLikeLayerParams = class BroadcastToLikeLay static decode(reader, length) { const message = new $root.CoreML.Specification.BroadcastToLikeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6800,8 +6800,8 @@ $root.CoreML.Specification.BroadcastToStaticLayerParams = class BroadcastToStati static decode(reader, length) { const message = new $root.CoreML.Specification.BroadcastToStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -6823,8 +6823,8 @@ $root.CoreML.Specification.BroadcastToDynamicLayerParams = class BroadcastToDyna static decode(reader, length) { const message = new $root.CoreML.Specification.BroadcastToDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6843,8 +6843,8 @@ $root.CoreML.Specification.AddBroadcastableLayerParams = class AddBroadcastableL static decode(reader, length) { const message = new $root.CoreML.Specification.AddBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6863,8 +6863,8 @@ $root.CoreML.Specification.MaxBroadcastableLayerParams = class MaxBroadcastableL static decode(reader, length) { const message = new $root.CoreML.Specification.MaxBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6883,8 +6883,8 @@ $root.CoreML.Specification.MinBroadcastableLayerParams = class MinBroadcastableL static decode(reader, length) { const message = new $root.CoreML.Specification.MinBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6903,8 +6903,8 @@ $root.CoreML.Specification.ModBroadcastableLayerParams = class ModBroadcastableL static decode(reader, length) { const message = new $root.CoreML.Specification.ModBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6923,8 +6923,8 @@ $root.CoreML.Specification.FloorDivBroadcastableLayerParams = class FloorDivBroa static decode(reader, length) { const message = new $root.CoreML.Specification.FloorDivBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6943,8 +6943,8 @@ $root.CoreML.Specification.SubtractBroadcastableLayerParams = class SubtractBroa static decode(reader, length) { const message = new $root.CoreML.Specification.SubtractBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6963,8 +6963,8 @@ $root.CoreML.Specification.MultiplyBroadcastableLayerParams = class MultiplyBroa static decode(reader, length) { const message = new $root.CoreML.Specification.MultiplyBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -6983,8 +6983,8 @@ $root.CoreML.Specification.DivideBroadcastableLayerParams = class DivideBroadcas static decode(reader, length) { const message = new $root.CoreML.Specification.DivideBroadcastableLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -7003,8 +7003,8 @@ $root.CoreML.Specification.GatherLayerParams = class GatherLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.GatherLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7038,8 +7038,8 @@ $root.CoreML.Specification.ScatterLayerParams = class ScatterLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ScatterLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7067,8 +7067,8 @@ $root.CoreML.Specification.GatherNDLayerParams = class GatherNDLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.GatherNDLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -7087,8 +7087,8 @@ $root.CoreML.Specification.ScatterNDLayerParams = class ScatterNDLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ScatterNDLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7112,8 +7112,8 @@ $root.CoreML.Specification.GatherAlongAxisLayerParams = class GatherAlongAxisLay static decode(reader, length) { const message = new $root.CoreML.Specification.GatherAlongAxisLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7137,8 +7137,8 @@ $root.CoreML.Specification.ScatterAlongAxisLayerParams = class ScatterAlongAxisL static decode(reader, length) { const message = new $root.CoreML.Specification.ScatterAlongAxisLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7166,8 +7166,8 @@ $root.CoreML.Specification.StackLayerParams = class StackLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.StackLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7192,8 +7192,8 @@ $root.CoreML.Specification.RankPreservingReshapeLayerParams = class RankPreservi static decode(reader, length) { const message = new $root.CoreML.Specification.RankPreservingReshapeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7216,8 +7216,8 @@ $root.CoreML.Specification.ConstantPaddingLayerParams = class ConstantPaddingLay static decode(reader, length) { const message = new $root.CoreML.Specification.ConstantPaddingLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7248,8 +7248,8 @@ $root.CoreML.Specification.RandomNormalLikeLayerParams = class RandomNormalLikeL static decode(reader, length) { const message = new $root.CoreML.Specification.RandomNormalLikeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7282,8 +7282,8 @@ $root.CoreML.Specification.RandomNormalStaticLayerParams = class RandomNormalSta static decode(reader, length) { const message = new $root.CoreML.Specification.RandomNormalStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7318,8 +7318,8 @@ $root.CoreML.Specification.RandomNormalDynamicLayerParams = class RandomNormalDy static decode(reader, length) { const message = new $root.CoreML.Specification.RandomNormalDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7351,8 +7351,8 @@ $root.CoreML.Specification.RandomUniformLikeLayerParams = class RandomUniformLik static decode(reader, length) { const message = new $root.CoreML.Specification.RandomUniformLikeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7385,8 +7385,8 @@ $root.CoreML.Specification.RandomUniformStaticLayerParams = class RandomUniformS static decode(reader, length) { const message = new $root.CoreML.Specification.RandomUniformStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7421,8 +7421,8 @@ $root.CoreML.Specification.RandomUniformDynamicLayerParams = class RandomUniform static decode(reader, length) { const message = new $root.CoreML.Specification.RandomUniformDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7454,8 +7454,8 @@ $root.CoreML.Specification.RandomBernoulliLikeLayerParams = class RandomBernoull static decode(reader, length) { const message = new $root.CoreML.Specification.RandomBernoulliLikeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7484,8 +7484,8 @@ $root.CoreML.Specification.RandomBernoulliStaticLayerParams = class RandomBernou static decode(reader, length) { const message = new $root.CoreML.Specification.RandomBernoulliStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7516,8 +7516,8 @@ $root.CoreML.Specification.RandomBernoulliDynamicLayerParams = class RandomBerno static decode(reader, length) { const message = new $root.CoreML.Specification.RandomBernoulliDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7545,8 +7545,8 @@ $root.CoreML.Specification.CategoricalDistributionLayerParams = class Categorica static decode(reader, length) { const message = new $root.CoreML.Specification.CategoricalDistributionLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7587,8 +7587,8 @@ $root.CoreML.Specification.ReduceL1LayerParams = class ReduceL1LayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceL1LayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7620,8 +7620,8 @@ $root.CoreML.Specification.ReduceL2LayerParams = class ReduceL2LayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceL2LayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7653,8 +7653,8 @@ $root.CoreML.Specification.ReduceMaxLayerParams = class ReduceMaxLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceMaxLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7686,8 +7686,8 @@ $root.CoreML.Specification.ReduceMinLayerParams = class ReduceMinLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceMinLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7719,8 +7719,8 @@ $root.CoreML.Specification.ReduceSumLayerParams = class ReduceSumLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceSumLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7752,8 +7752,8 @@ $root.CoreML.Specification.ReduceProdLayerParams = class ReduceProdLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceProdLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7785,8 +7785,8 @@ $root.CoreML.Specification.ReduceMeanLayerParams = class ReduceMeanLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceMeanLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7818,8 +7818,8 @@ $root.CoreML.Specification.ReduceLogSumLayerParams = class ReduceLogSumLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceLogSumLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7851,8 +7851,8 @@ $root.CoreML.Specification.ReduceSumSquareLayerParams = class ReduceSumSquareLay static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceSumSquareLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7884,8 +7884,8 @@ $root.CoreML.Specification.ReduceLogSumExpLayerParams = class ReduceLogSumExpLay static decode(reader, length) { const message = new $root.CoreML.Specification.ReduceLogSumExpLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7917,8 +7917,8 @@ $root.CoreML.Specification.ExpandDimsLayerParams = class ExpandDimsLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ExpandDimsLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7940,8 +7940,8 @@ $root.CoreML.Specification.FlattenTo2DLayerParams = class FlattenTo2DLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.FlattenTo2DLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7966,8 +7966,8 @@ $root.CoreML.Specification.ReshapeStaticLayerParams = class ReshapeStaticLayerPa static decode(reader, length) { const message = new $root.CoreML.Specification.ReshapeStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -7989,8 +7989,8 @@ $root.CoreML.Specification.ReshapeLikeLayerParams = class ReshapeLikeLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.ReshapeLikeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8009,8 +8009,8 @@ $root.CoreML.Specification.ReshapeDynamicLayerParams = class ReshapeDynamicLayer static decode(reader, length) { const message = new $root.CoreML.Specification.ReshapeDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8030,8 +8030,8 @@ $root.CoreML.Specification.SqueezeLayerParams = class SqueezeLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SqueezeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8058,8 +8058,8 @@ $root.CoreML.Specification.TopKLayerParams = class TopKLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.TopKLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8091,8 +8091,8 @@ $root.CoreML.Specification.ArgMaxLayerParams = class ArgMaxLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ArgMaxLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8120,8 +8120,8 @@ $root.CoreML.Specification.ArgMinLayerParams = class ArgMinLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ArgMinLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8150,8 +8150,8 @@ $root.CoreML.Specification.SplitNDLayerParams = class SplitNDLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SplitNDLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8182,8 +8182,8 @@ $root.CoreML.Specification.CeilLayerParams = class CeilLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CeilLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8202,8 +8202,8 @@ $root.CoreML.Specification.RoundLayerParams = class RoundLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.RoundLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8222,8 +8222,8 @@ $root.CoreML.Specification.FloorLayerParams = class FloorLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.FloorLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8242,8 +8242,8 @@ $root.CoreML.Specification.SignLayerParams = class SignLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.SignLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8262,8 +8262,8 @@ $root.CoreML.Specification.ClipLayerParams = class ClipLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ClipLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8297,8 +8297,8 @@ $root.CoreML.Specification.SliceStaticLayerParams = class SliceStaticLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.SliceStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8340,8 +8340,8 @@ $root.CoreML.Specification.SliceDynamicLayerParams = class SliceDynamicLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.SliceDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -8376,8 +8376,8 @@ $root.CoreML.Specification.TileLayerParams = class TileLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.TileLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8399,8 +8399,8 @@ $root.CoreML.Specification.GetShapeLayerParams = class GetShapeLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.GetShapeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8419,8 +8419,8 @@ $root.CoreML.Specification.ErfLayerParams = class ErfLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ErfLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -8439,8 +8439,8 @@ $root.CoreML.Specification.GeluLayerParams = class GeluLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.GeluLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8470,8 +8470,8 @@ $root.CoreML.Specification.RangeStaticLayerParams = class RangeStaticLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.RangeStaticLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8503,8 +8503,8 @@ $root.CoreML.Specification.RangeDynamicLayerParams = class RangeDynamicLayerPara static decode(reader, length) { const message = new $root.CoreML.Specification.RangeDynamicLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -8532,8 +8532,8 @@ $root.CoreML.Specification.SlidingWindowsLayerParams = class SlidingWindowsLayer static decode(reader, length) { const message = new $root.CoreML.Specification.SlidingWindowsLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8566,8 +8566,8 @@ $root.CoreML.Specification.LayerNormalizationLayerParams = class LayerNormalizat static decode(reader, length) { const message = new $root.CoreML.Specification.LayerNormalizationLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8602,8 +8602,8 @@ $root.CoreML.Specification.NonMaximumSuppressionLayerParams = class NonMaximumSu static decode(reader, length) { const message = new $root.CoreML.Specification.NonMaximumSuppressionLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8639,8 +8639,8 @@ $root.CoreML.Specification.ClampedReLULayerParams = class ClampedReLULayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.ClampedReLULayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8668,8 +8668,8 @@ $root.CoreML.Specification.ArgSortLayerParams = class ArgSortLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.ArgSortLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8697,8 +8697,8 @@ $root.CoreML.Specification.SliceBySizeLayerParams = class SliceBySizeLayerParams static decode(reader, length) { const message = new $root.CoreML.Specification.SliceBySizeLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -8733,8 +8733,8 @@ $root.CoreML.Specification.NeuralNetworkClassifier = class NeuralNetworkClassifi static decode(reader, length) { const message = new $root.CoreML.Specification.NeuralNetworkClassifier(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8782,8 +8782,8 @@ $root.CoreML.Specification.OneHotLayerParams = class OneHotLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.OneHotLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8819,8 +8819,8 @@ $root.CoreML.Specification.CumSumLayerParams = class CumSumLayerParams { static decode(reader, length) { const message = new $root.CoreML.Specification.CumSumLayerParams(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8854,8 +8854,8 @@ $root.CoreML.Specification.NeuralNetworkRegressor = class NeuralNetworkRegressor static decode(reader, length) { const message = new $root.CoreML.Specification.NeuralNetworkRegressor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8894,8 +8894,8 @@ $root.CoreML.Specification.NetworkUpdateParameters = class NetworkUpdateParamete static decode(reader, length) { const message = new $root.CoreML.Specification.NetworkUpdateParameters(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8939,8 +8939,8 @@ $root.CoreML.Specification.LossLayer = class LossLayer { static decode(reader, length) { const message = new $root.CoreML.Specification.LossLayer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8970,8 +8970,8 @@ $root.CoreML.Specification.CategoricalCrossEntropyLossLayer = class CategoricalC static decode(reader, length) { const message = new $root.CoreML.Specification.CategoricalCrossEntropyLossLayer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -8999,8 +8999,8 @@ $root.CoreML.Specification.MeanSquaredErrorLossLayer = class MeanSquaredErrorLos static decode(reader, length) { const message = new $root.CoreML.Specification.MeanSquaredErrorLossLayer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9033,8 +9033,8 @@ $root.CoreML.Specification.Optimizer = class Optimizer { static decode(reader, length) { const message = new $root.CoreML.Specification.Optimizer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 10: @@ -9059,8 +9059,8 @@ $root.CoreML.Specification.SGDOptimizer = class SGDOptimizer { static decode(reader, length) { const message = new $root.CoreML.Specification.SGDOptimizer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9092,8 +9092,8 @@ $root.CoreML.Specification.AdamOptimizer = class AdamOptimizer { static decode(reader, length) { const message = new $root.CoreML.Specification.AdamOptimizer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9133,8 +9133,8 @@ $root.CoreML.Specification.Normalizer = class Normalizer { static decode(reader, length) { const message = new $root.CoreML.Specification.Normalizer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9169,8 +9169,8 @@ $root.CoreML.Specification.OneHotEncoder = class OneHotEncoder { static decode(reader, length) { const message = new $root.CoreML.Specification.OneHotEncoder(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9211,8 +9211,8 @@ $root.CoreML.Specification.Scaler = class Scaler { static decode(reader, length) { const message = new $root.CoreML.Specification.Scaler(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9247,8 +9247,8 @@ $root.CoreML.Specification.NonMaximumSuppression = class NonMaximumSuppression { static decode(reader, length) { const message = new $root.CoreML.Specification.NonMaximumSuppression(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9309,8 +9309,8 @@ $root.CoreML.Specification.NonMaximumSuppression.PickTop = class PickTop { static decode(reader, length) { const message = new $root.CoreML.Specification.NonMaximumSuppression.PickTop(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9334,8 +9334,8 @@ $root.CoreML.Specification.LinearKernel = class LinearKernel { static decode(reader, length) { const message = new $root.CoreML.Specification.LinearKernel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -9354,8 +9354,8 @@ $root.CoreML.Specification.RBFKernel = class RBFKernel { static decode(reader, length) { const message = new $root.CoreML.Specification.RBFKernel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9379,8 +9379,8 @@ $root.CoreML.Specification.PolyKernel = class PolyKernel { static decode(reader, length) { const message = new $root.CoreML.Specification.PolyKernel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9412,8 +9412,8 @@ $root.CoreML.Specification.SigmoidKernel = class SigmoidKernel { static decode(reader, length) { const message = new $root.CoreML.Specification.SigmoidKernel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9446,8 +9446,8 @@ $root.CoreML.Specification.Kernel = class Kernel { static decode(reader, length) { const message = new $root.CoreML.Specification.Kernel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9478,8 +9478,8 @@ $root.CoreML.Specification.SparseNode = class SparseNode { static decode(reader, length) { const message = new $root.CoreML.Specification.SparseNode(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9508,8 +9508,8 @@ $root.CoreML.Specification.SparseVector = class SparseVector { static decode(reader, length) { const message = new $root.CoreML.Specification.SparseVector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9532,8 +9532,8 @@ $root.CoreML.Specification.SparseSupportVectors = class SparseSupportVectors { static decode(reader, length) { const message = new $root.CoreML.Specification.SparseSupportVectors(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9556,8 +9556,8 @@ $root.CoreML.Specification.DenseVector = class DenseVector { static decode(reader, length) { const message = new $root.CoreML.Specification.DenseVector(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9580,8 +9580,8 @@ $root.CoreML.Specification.DenseSupportVectors = class DenseSupportVectors { static decode(reader, length) { const message = new $root.CoreML.Specification.DenseSupportVectors(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9604,8 +9604,8 @@ $root.CoreML.Specification.Coefficients = class Coefficients { static decode(reader, length) { const message = new $root.CoreML.Specification.Coefficients(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9632,8 +9632,8 @@ $root.CoreML.Specification.SupportVectorRegressor = class SupportVectorRegressor static decode(reader, length) { const message = new $root.CoreML.Specification.SupportVectorRegressor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9686,8 +9686,8 @@ $root.CoreML.Specification.SupportVectorClassifier = class SupportVectorClassifi static decode(reader, length) { const message = new $root.CoreML.Specification.SupportVectorClassifier(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9747,8 +9747,8 @@ $root.CoreML.Specification.TreeEnsembleParameters = class TreeEnsembleParameters static decode(reader, length) { const message = new $root.CoreML.Specification.TreeEnsembleParameters(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9779,8 +9779,8 @@ $root.CoreML.Specification.TreeEnsembleParameters.TreeNode = class TreeNode { static decode(reader, length) { const message = new $root.CoreML.Specification.TreeEnsembleParameters.TreeNode(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9849,8 +9849,8 @@ $root.CoreML.Specification.TreeEnsembleParameters.TreeNode.EvaluationInfo = clas static decode(reader, length) { const message = new $root.CoreML.Specification.TreeEnsembleParameters.TreeNode.EvaluationInfo(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9883,8 +9883,8 @@ $root.CoreML.Specification.TreeEnsembleClassifier = class TreeEnsembleClassifier static decode(reader, length) { const message = new $root.CoreML.Specification.TreeEnsembleClassifier(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9918,8 +9918,8 @@ $root.CoreML.Specification.TreeEnsembleRegressor = class TreeEnsembleRegressor { static decode(reader, length) { const message = new $root.CoreML.Specification.TreeEnsembleRegressor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -9948,8 +9948,8 @@ $root.CoreML.Specification.ItemSimilarityRecommender = class ItemSimilarityRecom static decode(reader, length) { const message = new $root.CoreML.Specification.ItemSimilarityRecommender(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -10004,8 +10004,8 @@ $root.CoreML.Specification.ItemSimilarityRecommender.ConnectedItem = class Conne static decode(reader, length) { const message = new $root.CoreML.Specification.ItemSimilarityRecommender.ConnectedItem(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -10034,8 +10034,8 @@ $root.CoreML.Specification.ItemSimilarityRecommender.SimilarItems = class Simila static decode(reader, length) { const message = new $root.CoreML.Specification.ItemSimilarityRecommender.SimilarItems(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -10071,8 +10071,8 @@ $root.CoreML.Specification.LinkedModel = class LinkedModel { static decode(reader, length) { const message = new $root.CoreML.Specification.LinkedModel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -10094,8 +10094,8 @@ $root.CoreML.Specification.LinkedModelFile = class LinkedModelFile { static decode(reader, length) { const message = new $root.CoreML.Specification.LinkedModelFile(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/dnn-proto.js b/source/dnn-proto.js index db7fb0fcf8..2a1805af2b 100644 --- a/source/dnn-proto.js +++ b/source/dnn-proto.js @@ -14,8 +14,8 @@ $root.dnn.Model = class Model { static decode(reader, length) { const message = new $root.dnn.Model(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -62,8 +62,8 @@ $root.dnn.Parameter = class Parameter { static decode(reader, length) { const message = new $root.dnn.Parameter(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -91,8 +91,8 @@ $root.dnn.Shape = class Shape { static decode(reader, length) { const message = new $root.dnn.Shape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -130,8 +130,8 @@ $root.dnn.Node = class Node { static decode(reader, length) { const message = new $root.dnn.Node(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -162,8 +162,8 @@ $root.dnn.Layer = class Layer { static decode(reader, length) { const message = new $root.dnn.Layer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -302,8 +302,8 @@ $root.dnn.Buffer = class Buffer { static decode(reader, length) { const message = new $root.dnn.Buffer(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 5: @@ -327,8 +327,8 @@ $root.dnn.Tensor = class Tensor { static decode(reader, length) { const message = new $root.dnn.Tensor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/onnx-proto.js b/source/onnx-proto.js index c75a6bbdb6..c6f60208b7 100644 --- a/source/onnx-proto.js +++ b/source/onnx-proto.js @@ -26,8 +26,8 @@ $root.onnx.AttributeProto = class AttributeProto { static decode(reader, length) { const message = new $root.onnx.AttributeProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -183,8 +183,8 @@ $root.onnx.ValueInfoProto = class ValueInfoProto { static decode(reader, length) { const message = new $root.onnx.ValueInfoProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -242,8 +242,8 @@ $root.onnx.NodeProto = class NodeProto { static decode(reader, length) { const message = new $root.onnx.NodeProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -325,8 +325,8 @@ $root.onnx.TrainingInfoProto = class TrainingInfoProto { static decode(reader, length) { const message = new $root.onnx.TrainingInfoProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -389,8 +389,8 @@ $root.onnx.ModelProto = class ModelProto { static decode(reader, length) { const message = new $root.onnx.ModelProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -491,8 +491,8 @@ $root.onnx.StringStringEntryProto = class StringStringEntryProto { static decode(reader, length) { const message = new $root.onnx.StringStringEntryProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -541,8 +541,8 @@ $root.onnx.TensorAnnotation = class TensorAnnotation { static decode(reader, length) { const message = new $root.onnx.TensorAnnotation(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -596,8 +596,8 @@ $root.onnx.GraphProto = class GraphProto { static decode(reader, length) { const message = new $root.onnx.GraphProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -695,8 +695,8 @@ $root.onnx.TensorProto = class TensorProto { static decode(reader, length) { const message = new $root.onnx.TensorProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -840,8 +840,8 @@ $root.onnx.TensorProto.Segment = class Segment { static decode(reader, length) { const message = new $root.onnx.TensorProto.Segment(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -895,8 +895,8 @@ $root.onnx.SparseTensorProto = class SparseTensorProto { static decode(reader, length) { const message = new $root.onnx.SparseTensorProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -951,8 +951,8 @@ $root.onnx.TensorShapeProto = class TensorShapeProto { static decode(reader, length) { const message = new $root.onnx.TensorShapeProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -996,8 +996,8 @@ $root.onnx.TensorShapeProto.Dimension = class Dimension { static decode(reader, length) { const message = new $root.onnx.TensorShapeProto.Dimension(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1055,8 +1055,8 @@ $root.onnx.TypeProto = class TypeProto { static decode(reader, length) { const message = new $root.onnx.TypeProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1127,8 +1127,8 @@ $root.onnx.TypeProto.Tensor = class Tensor { static decode(reader, length) { const message = new $root.onnx.TypeProto.Tensor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1176,8 +1176,8 @@ $root.onnx.TypeProto.Sequence = class Sequence { static decode(reader, length) { const message = new $root.onnx.TypeProto.Sequence(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1218,8 +1218,8 @@ $root.onnx.TypeProto.Map = class Map { static decode(reader, length) { const message = new $root.onnx.TypeProto.Map(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1267,8 +1267,8 @@ $root.onnx.TypeProto.SparseTensor = class SparseTensor { static decode(reader, length) { const message = new $root.onnx.TypeProto.SparseTensor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1316,8 +1316,8 @@ $root.onnx.TypeProto.Opaque = class Opaque { static decode(reader, length) { const message = new $root.onnx.TypeProto.Opaque(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1365,8 +1365,8 @@ $root.onnx.OperatorSetIdProto = class OperatorSetIdProto { static decode(reader, length) { const message = new $root.onnx.OperatorSetIdProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1424,8 +1424,8 @@ $root.onnx.FunctionProto = class FunctionProto { static decode(reader, length) { const message = new $root.onnx.FunctionProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1517,8 +1517,8 @@ $root.onnx.OperatorProto = class OperatorProto { static decode(reader, length) { const message = new $root.onnx.OperatorProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1582,8 +1582,8 @@ $root.onnx.OperatorSetProto = class OperatorSetProto { static decode(reader, length) { const message = new $root.onnx.OperatorSetProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/paddle-proto.js b/source/paddle-proto.js index a83195ef6a..d7080d568d 100644 --- a/source/paddle-proto.js +++ b/source/paddle-proto.js @@ -13,8 +13,8 @@ $root.paddle.framework.proto.Version = class Version { static decode(reader, length) { const message = new $root.paddle.framework.proto.Version(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -73,8 +73,8 @@ $root.paddle.framework.proto.OpDesc = class OpDesc { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 3: @@ -151,8 +151,8 @@ $root.paddle.framework.proto.OpDesc.Attr = class Attr { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpDesc.Attr(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -289,8 +289,8 @@ $root.paddle.framework.proto.OpDesc.Var = class Var { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpDesc.Var(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -345,8 +345,8 @@ $root.paddle.framework.proto.OpProto = class OpProto { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -422,8 +422,8 @@ $root.paddle.framework.proto.OpProto.Var = class Var { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpProto.Var(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -502,8 +502,8 @@ $root.paddle.framework.proto.OpProto.Attr = class Attr { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpProto.Attr(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -580,8 +580,8 @@ $root.paddle.framework.proto.VarType = class VarType { static decode(reader, length) { const message = new $root.paddle.framework.proto.VarType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -690,8 +690,8 @@ $root.paddle.framework.proto.VarType.TensorDesc = class TensorDesc { static decode(reader, length) { const message = new $root.paddle.framework.proto.VarType.TensorDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -743,8 +743,8 @@ $root.paddle.framework.proto.VarType.LoDTensorDesc = class LoDTensorDesc { static decode(reader, length) { const message = new $root.paddle.framework.proto.VarType.LoDTensorDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -797,8 +797,8 @@ $root.paddle.framework.proto.VarType.LoDTensorArrayDesc = class LoDTensorArrayDe static decode(reader, length) { const message = new $root.paddle.framework.proto.VarType.LoDTensorArrayDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -852,8 +852,8 @@ $root.paddle.framework.proto.VarType.ReaderDesc = class ReaderDesc { static decode(reader, length) { const message = new $root.paddle.framework.proto.VarType.ReaderDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -893,8 +893,8 @@ $root.paddle.framework.proto.VarType.Tuple = class Tuple { static decode(reader, length) { const message = new $root.paddle.framework.proto.VarType.Tuple(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -933,8 +933,8 @@ $root.paddle.framework.proto.VarDesc = class VarDesc { static decode(reader, length) { const message = new $root.paddle.framework.proto.VarDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1008,8 +1008,8 @@ $root.paddle.framework.proto.BlockDesc = class BlockDesc { static decode(reader, length) { const message = new $root.paddle.framework.proto.BlockDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1086,8 +1086,8 @@ $root.paddle.framework.proto.OpVersion = class OpVersion { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpVersion(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1134,8 +1134,8 @@ $root.paddle.framework.proto.OpVersionMap = class OpVersionMap { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpVersionMap(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1174,8 +1174,8 @@ $root.paddle.framework.proto.OpVersionMap.OpVersionPair = class OpVersionPair { static decode(reader, length) { const message = new $root.paddle.framework.proto.OpVersionMap.OpVersionPair(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1234,8 +1234,8 @@ $root.paddle.framework.proto.ProgramDesc = class ProgramDesc { static decode(reader, length) { const message = new $root.paddle.framework.proto.ProgramDesc(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/protobuf.js b/source/protobuf.js index abb459b0e0..d876c6267c 100644 --- a/source/protobuf.js +++ b/source/protobuf.js @@ -26,15 +26,8 @@ protobuf.Reader = class { return new protobuf.Reader(buffer); } - next(length) { - if (length === undefined) { - return this._length; - } - return this._position + length; - } - - end(position) { - return this._position < position; + get length() { + return this._length; } get position() { diff --git a/source/tf-proto.js b/source/tf-proto.js index 31c525c9ba..b73aa70763 100644 --- a/source/tf-proto.js +++ b/source/tf-proto.js @@ -10,8 +10,8 @@ $root.tensorflow.SavedModel = class SavedModel { static decode(reader, length) { const message = new $root.tensorflow.SavedModel(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -61,8 +61,8 @@ $root.tensorflow.MetaGraphDef = class MetaGraphDef { static decode(reader, length) { const message = new $root.tensorflow.MetaGraphDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -144,8 +144,8 @@ $root.tensorflow.MetaGraphDef.MetaInfoDef = class MetaInfoDef { static decode(reader, length) { const message = new $root.tensorflow.MetaGraphDef.MetaInfoDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -238,8 +238,8 @@ $root.tensorflow.CollectionDef = class CollectionDef { static decode(reader, length) { const message = new $root.tensorflow.CollectionDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -303,8 +303,8 @@ $root.tensorflow.CollectionDef.NodeList = class NodeList { static decode(reader, length) { const message = new $root.tensorflow.CollectionDef.NodeList(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -344,8 +344,8 @@ $root.tensorflow.CollectionDef.BytesList = class BytesList { static decode(reader, length) { const message = new $root.tensorflow.CollectionDef.BytesList(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -385,8 +385,8 @@ $root.tensorflow.CollectionDef.Int64List = class Int64List { static decode(reader, length) { const message = new $root.tensorflow.CollectionDef.Int64List(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -426,8 +426,8 @@ $root.tensorflow.CollectionDef.FloatList = class FloatList { static decode(reader, length) { const message = new $root.tensorflow.CollectionDef.FloatList(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -467,8 +467,8 @@ $root.tensorflow.CollectionDef.AnyList = class AnyList { static decode(reader, length) { const message = new $root.tensorflow.CollectionDef.AnyList(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -512,8 +512,8 @@ $root.tensorflow.TensorInfo = class TensorInfo { static decode(reader, length) { const message = new $root.tensorflow.TensorInfo(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -579,8 +579,8 @@ $root.tensorflow.TensorInfo.CooSparse = class CooSparse { static decode(reader, length) { const message = new $root.tensorflow.TensorInfo.CooSparse(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -636,8 +636,8 @@ $root.tensorflow.TensorInfo.CompositeTensor = class CompositeTensor { static decode(reader, length) { const message = new $root.tensorflow.TensorInfo.CompositeTensor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -686,8 +686,8 @@ $root.tensorflow.SignatureDef = class SignatureDef { static decode(reader, length) { const message = new $root.tensorflow.SignatureDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -740,8 +740,8 @@ $root.tensorflow.AssetFileDef = class AssetFileDef { static decode(reader, length) { const message = new $root.tensorflow.AssetFileDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -790,8 +790,8 @@ $root.tensorflow.GraphDef = class GraphDef { static decode(reader, length) { const message = new $root.tensorflow.GraphDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -854,8 +854,8 @@ $root.tensorflow.FunctionDefLibrary = class FunctionDefLibrary { static decode(reader, length) { const message = new $root.tensorflow.FunctionDefLibrary(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -906,8 +906,8 @@ $root.tensorflow.FunctionDef = class FunctionDef { static decode(reader, length) { const message = new $root.tensorflow.FunctionDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -985,8 +985,8 @@ $root.tensorflow.FunctionDef.ArgAttrs = class ArgAttrs { static decode(reader, length) { const message = new $root.tensorflow.FunctionDef.ArgAttrs(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1025,8 +1025,8 @@ $root.tensorflow.GradientDef = class GradientDef { static decode(reader, length) { const message = new $root.tensorflow.GradientDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1079,8 +1079,8 @@ $root.tensorflow.AttrValue = class AttrValue { static decode(reader, length) { const message = new $root.tensorflow.AttrValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -1181,8 +1181,8 @@ $root.tensorflow.AttrValue.ListValue = class ListValue { static decode(reader, length) { const message = new $root.tensorflow.AttrValue.ListValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -1264,8 +1264,8 @@ $root.tensorflow.NameAttrList = class NameAttrList { static decode(reader, length) { const message = new $root.tensorflow.NameAttrList(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1325,8 +1325,8 @@ $root.tensorflow.TensorProto = class TensorProto { static decode(reader, length) { const message = new $root.tensorflow.TensorProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1467,8 +1467,8 @@ $root.tensorflow.VariantTensorDataProto = class VariantTensorDataProto { static decode(reader, length) { const message = new $root.tensorflow.VariantTensorDataProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1523,8 +1523,8 @@ $root.tensorflow.ResourceHandleProto = class ResourceHandleProto { static decode(reader, length) { const message = new $root.tensorflow.ResourceHandleProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1599,8 +1599,8 @@ $root.tensorflow.ResourceHandleProto.DtypeAndShape = class DtypeAndShape { static decode(reader, length) { const message = new $root.tensorflow.ResourceHandleProto.DtypeAndShape(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1649,8 +1649,8 @@ $root.tensorflow.TensorShapeProto = class TensorShapeProto { static decode(reader, length) { const message = new $root.tensorflow.TensorShapeProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -1697,8 +1697,8 @@ $root.tensorflow.TensorShapeProto.Dim = class Dim { static decode(reader, length) { const message = new $root.tensorflow.TensorShapeProto.Dim(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1804,8 +1804,8 @@ $root.tensorflow.NodeDef = class NodeDef { static decode(reader, length) { const message = new $root.tensorflow.NodeDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1881,8 +1881,8 @@ $root.tensorflow.NodeDef.ExperimentalDebugInfo = class ExperimentalDebugInfo { static decode(reader, length) { const message = new $root.tensorflow.NodeDef.ExperimentalDebugInfo(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -1931,8 +1931,8 @@ $root.tensorflow.OpDef = class OpDef { static decode(reader, length) { const message = new $root.tensorflow.OpDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2047,8 +2047,8 @@ $root.tensorflow.OpDef.ArgDef = class ArgDef { static decode(reader, length) { const message = new $root.tensorflow.OpDef.ArgDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2137,8 +2137,8 @@ $root.tensorflow.OpDef.AttrDef = class AttrDef { static decode(reader, length) { const message = new $root.tensorflow.OpDef.AttrDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2221,8 +2221,8 @@ $root.tensorflow.OpDeprecation = class OpDeprecation { static decode(reader, length) { const message = new $root.tensorflow.OpDeprecation(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2271,8 +2271,8 @@ $root.tensorflow.OpList = class OpList { static decode(reader, length) { const message = new $root.tensorflow.OpList(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2312,8 +2312,8 @@ $root.tensorflow.VersionDef = class VersionDef { static decode(reader, length) { const message = new $root.tensorflow.VersionDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2369,8 +2369,8 @@ $root.tensorflow.SavedObjectGraph = class SavedObjectGraph { static decode(reader, length) { const message = new $root.tensorflow.SavedObjectGraph(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2423,8 +2423,8 @@ $root.tensorflow.SavedObject = class SavedObject { static decode(reader, length) { const message = new $root.tensorflow.SavedObject(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2517,8 +2517,8 @@ $root.tensorflow.SavedUserObject = class SavedUserObject { static decode(reader, length) { const message = new $root.tensorflow.SavedUserObject(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2573,8 +2573,8 @@ $root.tensorflow.SavedAsset = class SavedAsset { static decode(reader, length) { const message = new $root.tensorflow.SavedAsset(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2616,8 +2616,8 @@ $root.tensorflow.SavedFunction = class SavedFunction { static decode(reader, length) { const message = new $root.tensorflow.SavedFunction(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2665,8 +2665,8 @@ $root.tensorflow.SavedConcreteFunction = class SavedConcreteFunction { static decode(reader, length) { const message = new $root.tensorflow.SavedConcreteFunction(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -2721,8 +2721,8 @@ $root.tensorflow.SavedBareConcreteFunction = class SavedBareConcreteFunction { static decode(reader, length) { const message = new $root.tensorflow.SavedBareConcreteFunction(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2783,8 +2783,8 @@ $root.tensorflow.SavedConstant = class SavedConstant { static decode(reader, length) { const message = new $root.tensorflow.SavedConstant(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2826,8 +2826,8 @@ $root.tensorflow.SavedVariable = class SavedVariable { static decode(reader, length) { const message = new $root.tensorflow.SavedVariable(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2916,8 +2916,8 @@ $root.tensorflow.FunctionSpec = class FunctionSpec { static decode(reader, length) { const message = new $root.tensorflow.FunctionSpec(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -2985,8 +2985,8 @@ $root.tensorflow.SavedResource = class SavedResource { static decode(reader, length) { const message = new $root.tensorflow.SavedResource(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3027,8 +3027,8 @@ $root.tensorflow.SaveableObject = class SaveableObject { static decode(reader, length) { const message = new $root.tensorflow.SaveableObject(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: @@ -3090,8 +3090,8 @@ $root.tensorflow.VariableDef = class VariableDef { static decode(reader, length) { const message = new $root.tensorflow.VariableDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3191,8 +3191,8 @@ $root.tensorflow.SaveSliceInfoDef = class SaveSliceInfoDef { static decode(reader, length) { const message = new $root.tensorflow.SaveSliceInfoDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3256,8 +3256,8 @@ $root.tensorflow.StructuredValue = class StructuredValue { static decode(reader, length) { const message = new $root.tensorflow.StructuredValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3374,8 +3374,8 @@ $root.tensorflow.NoneValue = class NoneValue { static decode(reader, length) { const message = new $root.tensorflow.NoneValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: @@ -3409,8 +3409,8 @@ $root.tensorflow.ListValue = class ListValue { static decode(reader, length) { const message = new $root.tensorflow.ListValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3450,8 +3450,8 @@ $root.tensorflow.TupleValue = class TupleValue { static decode(reader, length) { const message = new $root.tensorflow.TupleValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3491,8 +3491,8 @@ $root.tensorflow.DictValue = class DictValue { static decode(reader, length) { const message = new $root.tensorflow.DictValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3531,8 +3531,8 @@ $root.tensorflow.PairValue = class PairValue { static decode(reader, length) { const message = new $root.tensorflow.PairValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3581,8 +3581,8 @@ $root.tensorflow.NamedTupleValue = class NamedTupleValue { static decode(reader, length) { const message = new $root.tensorflow.NamedTupleValue(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3629,8 +3629,8 @@ $root.tensorflow.TensorSpecProto = class TensorSpecProto { static decode(reader, length) { const message = new $root.tensorflow.TensorSpecProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3685,8 +3685,8 @@ $root.tensorflow.BoundedTensorSpecProto = class BoundedTensorSpecProto { static decode(reader, length) { const message = new $root.tensorflow.BoundedTensorSpecProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3755,8 +3755,8 @@ $root.tensorflow.TypeSpecProto = class TypeSpecProto { static decode(reader, length) { const message = new $root.tensorflow.TypeSpecProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3827,8 +3827,8 @@ $root.tensorflow.TrackableObjectGraph = class TrackableObjectGraph { static decode(reader, length) { const message = new $root.tensorflow.TrackableObjectGraph(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3870,8 +3870,8 @@ $root.tensorflow.TrackableObjectGraph.TrackableObject = class TrackableObject { static decode(reader, length) { const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3922,8 +3922,8 @@ $root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference = class Ob static decode(reader, length) { const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.ObjectReference(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -3971,8 +3971,8 @@ $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor = class S static decode(reader, length) { const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.SerializedTensor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4034,8 +4034,8 @@ $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference = cl static decode(reader, length) { const message = new $root.tensorflow.TrackableObjectGraph.TrackableObject.SlotVariableReference(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4090,8 +4090,8 @@ $root.tensorflow.SaverDef = class SaverDef { static decode(reader, length) { const message = new $root.tensorflow.SaverDef(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4180,8 +4180,8 @@ $root.tensorflow.BundleHeaderProto = class BundleHeaderProto { static decode(reader, length) { const message = new $root.tensorflow.BundleHeaderProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4242,8 +4242,8 @@ $root.tensorflow.BundleEntryProto = class BundleEntryProto { static decode(reader, length) { const message = new $root.tensorflow.BundleEntryProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4326,8 +4326,8 @@ $root.tensorflow.TensorSliceProto = class TensorSliceProto { static decode(reader, length) { const message = new $root.tensorflow.TensorSliceProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4371,8 +4371,8 @@ $root.tensorflow.TensorSliceProto.Extent = class Extent { static decode(reader, length) { const message = new $root.tensorflow.TensorSliceProto.Extent(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4420,8 +4420,8 @@ $root.tensorflow.SavedSliceMeta = class SavedSliceMeta { static decode(reader, length) { const message = new $root.tensorflow.SavedSliceMeta(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4483,8 +4483,8 @@ $root.tensorflow.SavedTensorSliceMeta = class SavedTensorSliceMeta { static decode(reader, length) { const message = new $root.tensorflow.SavedTensorSliceMeta(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4531,8 +4531,8 @@ $root.tensorflow.SavedSlice = class SavedSlice { static decode(reader, length) { const message = new $root.tensorflow.SavedSlice(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4587,8 +4587,8 @@ $root.tensorflow.SavedTensorSlices = class SavedTensorSlices { static decode(reader, length) { const message = new $root.tensorflow.SavedTensorSlices(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4641,8 +4641,8 @@ $root.tensorflow.Event = class Event { static decode(reader, length) { const message = new $root.tensorflow.Event(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4732,8 +4732,8 @@ $root.tensorflow.LogMessage = class LogMessage { static decode(reader, length) { const message = new $root.tensorflow.LogMessage(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4790,8 +4790,8 @@ $root.tensorflow.SessionLog = class SessionLog { static decode(reader, length) { const message = new $root.tensorflow.SessionLog(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4853,8 +4853,8 @@ $root.tensorflow.TaggedRunMetadata = class TaggedRunMetadata { static decode(reader, length) { const message = new $root.tensorflow.TaggedRunMetadata(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4916,8 +4916,8 @@ $root.tensorflow.WatchdogConfig = class WatchdogConfig { static decode(reader, length) { const message = new $root.tensorflow.WatchdogConfig(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -4958,8 +4958,8 @@ $root.tensorflow.RequestedExitCode = class RequestedExitCode { static decode(reader, length) { const message = new $root.tensorflow.RequestedExitCode(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5000,8 +5000,8 @@ $root.tensorflow.WorkerHeartbeatRequest = class WorkerHeartbeatRequest { static decode(reader, length) { const message = new $root.tensorflow.WorkerHeartbeatRequest(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5057,8 +5057,8 @@ $root.tensorflow.WorkerHeartbeatResponse = class WorkerHeartbeatResponse { static decode(reader, length) { const message = new $root.tensorflow.WorkerHeartbeatResponse(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5112,8 +5112,8 @@ $root.tensorflow.SummaryDescription = class SummaryDescription { static decode(reader, length) { const message = new $root.tensorflow.SummaryDescription(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5156,8 +5156,8 @@ $root.tensorflow.HistogramProto = class HistogramProto { static decode(reader, length) { const message = new $root.tensorflow.HistogramProto(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5238,8 +5238,8 @@ $root.tensorflow.SummaryMetadata = class SummaryMetadata { static decode(reader, length) { const message = new $root.tensorflow.SummaryMetadata(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5301,8 +5301,8 @@ $root.tensorflow.SummaryMetadata.PluginData = class PluginData { static decode(reader, length) { const message = new $root.tensorflow.SummaryMetadata.PluginData(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5358,8 +5358,8 @@ $root.tensorflow.Summary = class Summary { static decode(reader, length) { const message = new $root.tensorflow.Summary(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5398,8 +5398,8 @@ $root.tensorflow.Summary.Image = class Image { static decode(reader, length) { const message = new $root.tensorflow.Summary.Image(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5461,8 +5461,8 @@ $root.tensorflow.Summary.Audio = class Audio { static decode(reader, length) { const message = new $root.tensorflow.Summary.Audio(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -5536,8 +5536,8 @@ $root.tensorflow.Summary.Value = class Value { static decode(reader, length) { const message = new $root.tensorflow.Summary.Value(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 7: @@ -5632,8 +5632,8 @@ $root.google.protobuf.Any = class Any { static decode(reader, length) { const message = new $root.google.protobuf.Any(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/uff-proto.js b/source/uff-proto.js index 173a485507..e0f3538558 100644 --- a/source/uff-proto.js +++ b/source/uff-proto.js @@ -13,8 +13,8 @@ $root.uff.MetaGraph = class MetaGraph { static decode(reader, length) { const message = new $root.uff.MetaGraph(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -86,8 +86,8 @@ $root.uff.MetaGraph.ReferencedDataEntry = class ReferencedDataEntry { static decode(reader, length) { const message = new $root.uff.MetaGraph.ReferencedDataEntry(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -135,8 +135,8 @@ $root.uff.MetaGraph.ExtraFieldsEntry = class ExtraFieldsEntry { static decode(reader, length) { const message = new $root.uff.MetaGraph.ExtraFieldsEntry(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -184,8 +184,8 @@ $root.uff.Descriptor = class Descriptor { static decode(reader, length) { const message = new $root.uff.Descriptor(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -242,8 +242,8 @@ $root.uff.Graph = class Graph { static decode(reader, length) { const message = new $root.uff.Graph(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -296,8 +296,8 @@ $root.uff.Graph.ExtraFieldsEntry = class ExtraFieldsEntry { static decode(reader, length) { const message = new $root.uff.Graph.ExtraFieldsEntry(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -348,8 +348,8 @@ $root.uff.Node = class Node { static decode(reader, length) { const message = new $root.uff.Node(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -415,8 +415,8 @@ $root.uff.Node.FieldsEntry = class FieldsEntry { static decode(reader, length) { const message = new $root.uff.Node.FieldsEntry(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -464,8 +464,8 @@ $root.uff.Node.ExtraFieldsEntry = class ExtraFieldsEntry { static decode(reader, length) { const message = new $root.uff.Node.ExtraFieldsEntry(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -518,8 +518,8 @@ $root.uff.Data = class Data { static decode(reader, length) { const message = new $root.uff.Data(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -654,8 +654,8 @@ $root.uff.DimensionOrders = class DimensionOrders { static decode(reader, length) { const message = new $root.uff.DimensionOrders(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -694,8 +694,8 @@ $root.uff.DimensionOrders.OrdersEntry = class OrdersEntry { static decode(reader, length) { const message = new $root.uff.DimensionOrders.OrdersEntry(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -744,8 +744,8 @@ $root.uff.ListString = class ListString { static decode(reader, length) { const message = new $root.uff.ListString(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -785,8 +785,8 @@ $root.uff.ListDouble = class ListDouble { static decode(reader, length) { const message = new $root.uff.ListDouble(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -826,8 +826,8 @@ $root.uff.ListBool = class ListBool { static decode(reader, length) { const message = new $root.uff.ListBool(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -867,8 +867,8 @@ $root.uff.ListInt64 = class ListInt64 { static decode(reader, length) { const message = new $root.uff.ListInt64(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -908,8 +908,8 @@ $root.uff.ListDataType = class ListDataType { static decode(reader, length) { const message = new $root.uff.ListDataType(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: @@ -949,8 +949,8 @@ $root.uff.ListDimensionOrders = class ListDimensionOrders { static decode(reader, length) { const message = new $root.uff.ListDimensionOrders(); - const end = reader.next(length); - while (reader.end(end)) { + const end = length !== undefined ? reader.position + length : reader.length; + while (reader.position < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: diff --git a/source/view.js b/source/view.js index 39f0449564..80de716fe3 100644 --- a/source/view.js +++ b/source/view.js @@ -1087,8 +1087,8 @@ view.ModelContext = class { } case 'pb': { const reader = protobuf.Reader.create(this.buffer); - const end = reader.next(); - while (reader.position < end) { + const length = reader.length; + while (reader.position < length) { const tag = reader.uint32(); const number = tag >>> 3; const type = tag & 7; diff --git a/tools/protoc.js b/tools/protoc.js index c205b0cb56..139374811d 100644 --- a/tools/protoc.js +++ b/tools/protoc.js @@ -1253,8 +1253,8 @@ protoc.Generator = class { this._builder.add('static decode(reader, length) {'); this._builder.indent(); this._builder.add('const message = new $root' + type.fullName + '();'); - this._builder.add('const end = reader.next(length);'); - this._builder.add("while (reader.end(end)) {"); + this._builder.add('const end = length !== undefined ? reader.position + length : reader.length;'); + this._builder.add("while (reader.position < end) {"); this._builder.indent(); this._builder.add("const tag = reader.uint32();"); if (type.group) {