コード例 #1
0
        public void MergeFrom(AttrValue other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.ValueCase)
            {
            case ValueOneofCase.S:
                S = other.S;
                break;

            case ValueOneofCase.I:
                I = other.I;
                break;

            case ValueOneofCase.F:
                F = other.F;
                break;

            case ValueOneofCase.B:
                B = other.B;
                break;

            case ValueOneofCase.Type:
                Type = other.Type;
                break;

            case ValueOneofCase.Shape:
                if (Shape == null)
                {
                    Shape = new global::Tensorflow.TensorShapeProto();
                }
                Shape.MergeFrom(other.Shape);
                break;

            case ValueOneofCase.Tensor:
                if (Tensor == null)
                {
                    Tensor = new global::Tensorflow.TensorProto();
                }
                Tensor.MergeFrom(other.Tensor);
                break;

            case ValueOneofCase.List:
                if (List == null)
                {
                    List = new global::Tensorflow.AttrValue.Types.ListValue();
                }
                List.MergeFrom(other.List);
                break;

            case ValueOneofCase.Func:
                if (Func == null)
                {
                    Func = new global::Tensorflow.NameAttrList();
                }
                Func.MergeFrom(other.Func);
                break;

            case ValueOneofCase.Placeholder:
                Placeholder = other.Placeholder;
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }