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

        cpu_only = False
        if len(self.gpus) == 0 or not cuda.is_available():
            cpu_only = True

        new_profile_models = {}
        for model in self.profile_models:
            new_model = {'cpu_only': (model.cpu_only() or cpu_only)}

            # 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._fields[
                        'constraints'].value():
                    new_model['constraints'] = self.constraints
            else:
                new_model['constraints'] = model.constraints()

            # Run parameters
            if not model.parameters():
                new_model['parameters'] = {
                    'batch_sizes': self.batch_sizes,
                    'concurrency': self.concurrency
                }
            elif 'batch_sizes' not in model.parameters():
                new_model['parameters'] = {
                    'batch_sizes': self.batch_sizes,
                    'concurrency': model.parameters()['concurrency']
                }
            elif 'concurrency' not in model.parameters():
                new_model['parameters'] = {
                    'batch_sizes': model.parameters()['batch_sizes'],
                    'concurrency': self.concurrency
                }
            else:
                new_model['parameters'] = model.parameters()

            # Perf analyzer flags
            if not model.perf_analyzer_flags():
                new_model['perf_analyzer_flags'] = self.perf_analyzer_flags
            else:
                new_model['perf_analyzer_flags'] = model.perf_analyzer_flags()

            # triton server flags
            if not model.triton_server_flags():
                new_model['triton_server_flags'] = self.triton_server_flags
            else:
                new_model['triton_server_flags'] = model.triton_server_flags()

            # triton server env
            if not model.triton_server_environment():
                new_model[
                    'triton_server_environment'] = self.triton_server_environment
            else:
                new_model[
                    'triton_server_environment'] = model.triton_server_environment(
                    )

            # Transfer model config parameters directly
            if model.model_config_parameters():
                new_model[
                    'model_config_parameters'] = model.model_config_parameters(
                    )

            new_profile_models[model.model_name()] = new_model
        self._fields['profile_models'].set_value(new_profile_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):
        cpu_only = False
        if len(self.gpus) == 0 or not cuda.is_available():
            cpu_only = True
        new_profile_models = {}
        for model in self.profile_models:
            new_model = {'cpu_only': (model.cpu_only() or cpu_only)}
            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._fields[
                        'constraints'].value():
                    new_model['constraints'] = self.constraints
            else:
                new_model['constraints'] = model.constraints()
            if not model.parameters():
                new_model['parameters'] = {
                    'batch_sizes': self.batch_sizes,
                    'concurrency': self.concurrency
                }
            elif 'batch_sizes' not in model.parameters():
                new_model['parameters'] = {
                    'batch_sizes': self.batch_sizes,
                    'concurrency': model.parameters()['concurrency']
                }
            elif 'concurrency' not in model.parameters():
                new_model['parameters'] = {
                    'batch_sizes': model.parameters()['batch_sizes'],
                    'concurrency': self.concurrency
                }
            else:
                new_model['parameters'] = model.parameters()
            if not model.perf_analyzer_flags():
                new_model['perf_analyzer_flags'] = self.perf_analyzer_flags
            else:
                new_model['perf_analyzer_flags'] = model.perf_analyzer_flags()
            if not model.triton_server_flags():
                new_model['triton_server_flags'] = self.triton_server_flags
            else:
                new_model['triton_server_flags'] = model.triton_server_flags()
            if not model.triton_server_environment():
                new_model[
                    'triton_server_environment'] = self.triton_server_environment
            else:
                new_model[
                    'triton_server_environment'] = model.triton_server_environment(
                    )
            if model.model_config_parameters():
                new_model[
                    'model_config_parameters'] = model.model_config_parameters(
                    )
            new_profile_models[model.model_name()] = new_model
        self._fields['profile_models'].set_value(new_profile_models)
def _autofill_values ( self ) : cpu_only = False if len ( self . gpus ) == 0 or not cuda . is_available ( ) : cpu_only = True new_profile_models = { } for model in self . profile_models : new_model = { 'cpu_only' : ( model . cpu_only ( ) or cpu_only ) } 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 . _fields [ 'constraints' ] . value ( ) : new_model [ 'constraints' ] = self . constraints else : new_model [ 'constraints' ] = model . constraints ( ) if not model . parameters ( ) : new_model [ 'parameters' ] = { 'batch_sizes' : self . batch_sizes , 'concurrency' : self . concurrency } elif 'batch_sizes' not in model . parameters ( ) : new_model [ 'parameters' ] = { 'batch_sizes' : self . batch_sizes , 'concurrency' : model . parameters ( ) [ 'concurrency' ] } elif 'concurrency' not in model . parameters ( ) : new_model [ 'parameters' ] = { 'batch_sizes' : model . parameters ( ) [ 'batch_sizes' ] , 'concurrency' : self . concurrency } else : new_model [ 'parameters' ] = model . parameters ( ) if not model . perf_analyzer_flags ( ) : new_model [ 'perf_analyzer_flags' ] = self . perf_analyzer_flags else : new_model [ 'perf_analyzer_flags' ] = model . perf_analyzer_flags ( ) if not model . triton_server_flags ( ) : new_model [ 'triton_server_flags' ] = self . triton_server_flags else : new_model [ 'triton_server_flags' ] = model . triton_server_flags ( ) if not model . triton_server_environment ( ) : new_model [ 'triton_server_environment' ] = self . triton_server_environment else : new_model [ 'triton_server_environment' ] = model . triton_server_environment ( ) if model . model_config_parameters ( ) : new_model [ 'model_config_parameters' ] = model . model_config_parameters ( ) new_profile_models [ model . model_name ( ) ] = new_model self . _fields [ 'profile_models' ] . set_value ( new_profile_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.
        """ # Objectives # Constraints # Run parameters # Perf analyzer flags # triton server flags # triton server env # Transfer model config parameters directly
self