Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (metricsCase_ == MetricsOneofCase.ClassificationEvaluationMetrics)
            {
                hash ^= ClassificationEvaluationMetrics.GetHashCode();
            }
            if (metricsCase_ == MetricsOneofCase.RegressionEvaluationMetrics)
            {
                hash ^= RegressionEvaluationMetrics.GetHashCode();
            }
            if (metricsCase_ == MetricsOneofCase.TranslationEvaluationMetrics)
            {
                hash ^= TranslationEvaluationMetrics.GetHashCode();
            }
            if (metricsCase_ == MetricsOneofCase.ImageObjectDetectionEvaluationMetrics)
            {
                hash ^= ImageObjectDetectionEvaluationMetrics.GetHashCode();
            }
            if (metricsCase_ == MetricsOneofCase.VideoObjectTrackingEvaluationMetrics)
            {
                hash ^= VideoObjectTrackingEvaluationMetrics.GetHashCode();
            }
            if (metricsCase_ == MetricsOneofCase.TextSentimentEvaluationMetrics)
            {
                hash ^= TextSentimentEvaluationMetrics.GetHashCode();
            }
            if (metricsCase_ == MetricsOneofCase.TextExtractionEvaluationMetrics)
            {
                hash ^= TextExtractionEvaluationMetrics.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (AnnotationSpecId.Length != 0)
            {
                hash ^= AnnotationSpecId.GetHashCode();
            }
            if (DisplayName.Length != 0)
            {
                hash ^= DisplayName.GetHashCode();
            }
            if (createTime_ != null)
            {
                hash ^= CreateTime.GetHashCode();
            }
            if (EvaluatedExampleCount != 0)
            {
                hash ^= EvaluatedExampleCount.GetHashCode();
            }
            hash ^= (int)metricsCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 2
0
        public void MergeFrom(ModelEvaluation other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Name.Length != 0)
            {
                Name = other.Name;
            }
            if (other.AnnotationSpecId.Length != 0)
            {
                AnnotationSpecId = other.AnnotationSpecId;
            }
            if (other.DisplayName.Length != 0)
            {
                DisplayName = other.DisplayName;
            }
            if (other.createTime_ != null)
            {
                if (createTime_ == null)
                {
                    CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                }
                CreateTime.MergeFrom(other.CreateTime);
            }
            if (other.EvaluatedExampleCount != 0)
            {
                EvaluatedExampleCount = other.EvaluatedExampleCount;
            }
            switch (other.MetricsCase)
            {
            case MetricsOneofCase.ClassificationEvaluationMetrics:
                if (ClassificationEvaluationMetrics == null)
                {
                    ClassificationEvaluationMetrics = new global::Google.Cloud.Automl.V1Beta1.ClassificationEvaluationMetrics();
                }
                ClassificationEvaluationMetrics.MergeFrom(other.ClassificationEvaluationMetrics);
                break;

            case MetricsOneofCase.RegressionEvaluationMetrics:
                if (RegressionEvaluationMetrics == null)
                {
                    RegressionEvaluationMetrics = new global::Google.Cloud.Automl.V1Beta1.RegressionEvaluationMetrics();
                }
                RegressionEvaluationMetrics.MergeFrom(other.RegressionEvaluationMetrics);
                break;

            case MetricsOneofCase.TranslationEvaluationMetrics:
                if (TranslationEvaluationMetrics == null)
                {
                    TranslationEvaluationMetrics = new global::Google.Cloud.Automl.V1Beta1.TranslationEvaluationMetrics();
                }
                TranslationEvaluationMetrics.MergeFrom(other.TranslationEvaluationMetrics);
                break;

            case MetricsOneofCase.ImageObjectDetectionEvaluationMetrics:
                if (ImageObjectDetectionEvaluationMetrics == null)
                {
                    ImageObjectDetectionEvaluationMetrics = new global::Google.Cloud.Automl.V1Beta1.ImageObjectDetectionEvaluationMetrics();
                }
                ImageObjectDetectionEvaluationMetrics.MergeFrom(other.ImageObjectDetectionEvaluationMetrics);
                break;

            case MetricsOneofCase.VideoObjectTrackingEvaluationMetrics:
                if (VideoObjectTrackingEvaluationMetrics == null)
                {
                    VideoObjectTrackingEvaluationMetrics = new global::Google.Cloud.Automl.V1Beta1.VideoObjectTrackingEvaluationMetrics();
                }
                VideoObjectTrackingEvaluationMetrics.MergeFrom(other.VideoObjectTrackingEvaluationMetrics);
                break;

            case MetricsOneofCase.TextSentimentEvaluationMetrics:
                if (TextSentimentEvaluationMetrics == null)
                {
                    TextSentimentEvaluationMetrics = new global::Google.Cloud.Automl.V1Beta1.TextSentimentEvaluationMetrics();
                }
                TextSentimentEvaluationMetrics.MergeFrom(other.TextSentimentEvaluationMetrics);
                break;

            case MetricsOneofCase.TextExtractionEvaluationMetrics:
                if (TextExtractionEvaluationMetrics == null)
                {
                    TextExtractionEvaluationMetrics = new global::Google.Cloud.Automl.V1Beta1.TextExtractionEvaluationMetrics();
                }
                TextExtractionEvaluationMetrics.MergeFrom(other.TextExtractionEvaluationMetrics);
                break;
            }

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