model_analyzer/config/input/config_command_analyze.py
def _autofill_values(self):
        """
        Fill in the implied or default
        config values.
        """

        # Set global constraints if latency budget is specified
        if self.latency_budget:
            if self.constraints:
                constraints = self.constraints
                constraints['perf_latency_p99'] = {'max': self.latency_budget}
                if 'perf_latency' in constraints:
                    # In case a tighter perf_latency is provided
                    constraints['perf_latency'] = constraints[
                        'perf_latency_p99']
                self._fields['constraints'].set_value(constraints)
            else:
                self._fields['constraints'].set_value(
                    {'perf_latency_p99': {
                        'max': self.latency_budget
                    }})

        # Set global constraints if latency budget is specified
        if self.min_throughput:
            if self.constraints:
                constraints = self.constraints
                constraints['perf_throughput'] = {'min': self.min_throughput}
                self._fields['constraints'].set_value(constraints)
            else:
                self._fields['constraints'].set_value(
                    {'perf_throughput': {
                        'min': self.min_throughput
                    }})

        new_analysis_models = {}
        for model in self.analysis_models:
            new_model = {}

            # Objectives
            if not model.objectives():
                new_model['objectives'] = self.objectives
            else:
                new_model['objectives'] = model.objectives()
            # Constraints
            if not model.constraints():
                if 'constraints' in self._fields and self.constraints:
                    new_model['constraints'] = self.constraints
            else:
                new_model['constraints'] = model.constraints()

            # Shorthands
            if self.latency_budget:
                if 'constraints' in new_model:
                    new_model['constraints']['perf_latency_p99'] = {
                        'max': self.latency_budget
                    }
                    if 'perf_latency' in new_model['constraints']:
                        # In case a tighter perf_latency is provided
                        new_model['constraints']['perf_latency'] = new_model[
                            'constraints']['perf_latency_p99']
                else:
                    new_model['constraints'] = {
                        'perf_latency_p99': {
                            'max': self.latency_budget
                        }
                    }

            if self.min_throughput:
                if 'constraints' in new_model:
                    new_model['constraints']['perf_throughput'] = {
                        'min': self.min_throughput
                    }
                else:
                    new_model['constraints'] = {
                        'perf_throughput': {
                            'min': self.min_throughput
                        }
                    }
            new_analysis_models[model.model_name()] = new_model
        self._fields['analysis_models'].set_value(new_analysis_models)

        Fill in the implied or default
        config values.
        
Fill in the implied or default
config values.
Fill in the implied or default config values .
def _autofill_values(self):
        if self.latency_budget:
            if self.constraints:
                constraints = self.constraints
                constraints['perf_latency_p99'] = {'max': self.latency_budget}
                if 'perf_latency' in constraints:
                    constraints['perf_latency'] = constraints[
                        'perf_latency_p99']
                self._fields['constraints'].set_value(constraints)
            else:
                self._fields['constraints'].set_value(
                    {'perf_latency_p99': {
                        'max': self.latency_budget
                    }})
        if self.min_throughput:
            if self.constraints:
                constraints = self.constraints
                constraints['perf_throughput'] = {'min': self.min_throughput}
                self._fields['constraints'].set_value(constraints)
            else:
                self._fields['constraints'].set_value(
                    {'perf_throughput': {
                        'min': self.min_throughput
                    }})
        new_analysis_models = {}
        for model in self.analysis_models:
            new_model = {}
            if not model.objectives():
                new_model['objectives'] = self.objectives
            else:
                new_model['objectives'] = model.objectives()
            if not model.constraints():
                if 'constraints' in self._fields and self.constraints:
                    new_model['constraints'] = self.constraints
            else:
                new_model['constraints'] = model.constraints()
            if self.latency_budget:
                if 'constraints' in new_model:
                    new_model['constraints']['perf_latency_p99'] = {
                        'max': self.latency_budget
                    }
                    if 'perf_latency' in new_model['constraints']:
                        new_model['constraints']['perf_latency'] = new_model[
                            'constraints']['perf_latency_p99']
                else:
                    new_model['constraints'] = {
                        'perf_latency_p99': {
                            'max': self.latency_budget
                        }
                    }
            if self.min_throughput:
                if 'constraints' in new_model:
                    new_model['constraints']['perf_throughput'] = {
                        'min': self.min_throughput
                    }
                else:
                    new_model['constraints'] = {
                        'perf_throughput': {
                            'min': self.min_throughput
                        }
                    }
            new_analysis_models[model.model_name()] = new_model
        self._fields['analysis_models'].set_value(new_analysis_models)
def _autofill_values ( self ) : if self . latency_budget : if self . constraints : constraints = self . constraints constraints [ 'perf_latency_p99' ] = { 'max' : self . latency_budget } if 'perf_latency' in constraints : constraints [ 'perf_latency' ] = constraints [ 'perf_latency_p99' ] self . _fields [ 'constraints' ] . set_value ( constraints ) else : self . _fields [ 'constraints' ] . set_value ( { 'perf_latency_p99' : { 'max' : self . latency_budget } } ) if self . min_throughput : if self . constraints : constraints = self . constraints constraints [ 'perf_throughput' ] = { 'min' : self . min_throughput } self . _fields [ 'constraints' ] . set_value ( constraints ) else : self . _fields [ 'constraints' ] . set_value ( { 'perf_throughput' : { 'min' : self . min_throughput } } ) new_analysis_models = { } for model in self . analysis_models : new_model = { } if not model . objectives ( ) : new_model [ 'objectives' ] = self . objectives else : new_model [ 'objectives' ] = model . objectives ( ) if not model . constraints ( ) : if 'constraints' in self . _fields and self . constraints : new_model [ 'constraints' ] = self . constraints else : new_model [ 'constraints' ] = model . constraints ( ) if self . latency_budget : if 'constraints' in new_model : new_model [ 'constraints' ] [ 'perf_latency_p99' ] = { 'max' : self . latency_budget } if 'perf_latency' in new_model [ 'constraints' ] : new_model [ 'constraints' ] [ 'perf_latency' ] = new_model [ 'constraints' ] [ 'perf_latency_p99' ] else : new_model [ 'constraints' ] = { 'perf_latency_p99' : { 'max' : self . latency_budget } } if self . min_throughput : if 'constraints' in new_model : new_model [ 'constraints' ] [ 'perf_throughput' ] = { 'min' : self . min_throughput } else : new_model [ 'constraints' ] = { 'perf_throughput' : { 'min' : self . min_throughput } } new_analysis_models [ model . model_name ( ) ] = new_model self . _fields [ 'analysis_models' ] . set_value ( new_analysis_models )
Fill in the implied or default
config values.
Fill in the implied or default config values .
"""
        Fill in the implied or default
        config values.
        """ # Set global constraints if latency budget is specified # In case a tighter perf_latency is provided # Set global constraints if latency budget is specified # Objectives # Constraints # Shorthands # In case a tighter perf_latency is provided
self