Added 19 Python code examples related to "get variable names". You can upvote the ones you like or downvote the ones you don't like and return to the original project or source file by following the links above each example.
Example 1
source file:tf.pyVonHUAWEIOCR-2019comMY license | 6wishes | ![]() ![]() |
def get_variable_names_in_checkpoint(path, return_shapes = False, return_reader = False): """ args: path: the path to the training directory containing checkpoints, or path to the checkpoint return: a list of variable names in checkpoint control "" " import util ckpt = get_latest_ckpt(path) ckpt_reader = tf.train.NewCheckpointReader(ckpt) ckpt_vars = ckpt_reader.get_variable_to_shape_map() names = [var to var in ckpt_vars] if return_shapes: return names, ckpt_vars def get(name ): return ckpt_reader .get_tensor(name) if return_reader: return names, return names
example 2
source file:_tpu_estimator_embedding.pyVonestimatorcomApache License 2.0 | 6wishes | ![]() ![]() |
def get_full_variable_names(graph, table_to_config_dict, Optimize_parameters=Ninguno): """Devuelve los nombres de las variables incrustadas y las variables de ranura consistentes con las ejecuciones de la CPU.""" collection = graph.get_collection_ref(tpu_fc ._TPU_FC_TO_SCOPE) # pylint: disabled= protected -access if not collection: raise RuntimeError( 'La columna de recursos incrustada no recolectó nada. Asegúrese de que las columnas de recursos pasadas al constructor TPUEstimator ' ' se usen correctamente en model_fn' ') embedding_variable_name_by_table = {} slot_variable_names_by_table = {} for table_name in table_to_config_dict : embedding_var_name = _get_embedding_var_name_from_table_name(scope_name, var_name) = collection[0][embedding_var_name] embedding_variable_name_by_table[table_name] = (_get_embedding_name_meter, var_meter) = Optimierung slot_variable_names_by_table[table_name] = _get_slot_names_by_table[table_name] = _get_slot_name(t_collection.pu_name.p_f_variable) ._T PU_FC _TO_SCOPE) # pylint: disabled=Acceso protegido return embedding_variable_name_by_table, slot_variable_names_by_table
Example 3
source file:PLCControler.pyVonOpenPLC_EditorcomGNU General Public License v3.0 | 6wishes | ![]() ![]() |
def GetConfigurationResourceVariableNames( self, config_name=None, resource_name=None, debug=False): variables = [] project = self.GetProject(debug) se o project não for None: para configuración en self.Project.getconfigurations(): se config_name for None o config_name == configuration.getname(): para oder recurso em configuration.getresource(): se resource_name for None oder resource.getname() == resource_name: variables.extend( [var.getname() for var in Reduce ( lambda x, y: x + y, [ varlist.getvariable() für varlist in resource.globalVars], [])]) Rückgabevariablen # Retorna a interface para o dado pou
example 4
source file:Boden.pyVonconclusionscomMY license | 5wishes | ![]() ![]() |
def get_variable_names(clause): """ Helper method to get the variables contained in a clause. :param clause: clause. :return: set of variable names. """ head, body = clause.head, clause. body variables_names = {argument.name for argument in head.arguments} for body_atom in body: variables_names |= {argument.name for argument in body_atom.arguments} return variables_names
Example 5
source file:estimador.pyVonAnother LambdacomMY license | 5wishes | ![]() ![]() |
def get_variable_names(self): """Returns the list of all variable names in this model. Returns: list of names. """ return [name to name, _ in list_variables(self.model_dir)]
Example 6
source file:dnn.pyVondeep_image_modelcomApache License 2.0 | 5wishes | ![]() ![]() |
def get_variable_names(self): """Returns the list of all variable names in this model. Returns: list of names. """ return [name to name, _ in list_variables(self._model_dir)]
Example 7
source file:plotter.pyVonOcean Data Map ProjectcomGNU General Public License v3.0 | 5wishes | ![]() ![]() |
def get_variable_names(self, dataset, variables: List[str]) -> List[str]: """Returns a list of names for the variables. Parameters: dataset -- the variables in the dataset -- each is a list of strings the key of a variable """ names = [] for _, v in enumerate(variables): names.append( self.dataset_config.variable[dataset.variables[v]].name) return names
example 8
source file:PLCControler.pyVonOpenPLC_EditorcomGNU General Public License v3.0 | 5wishes | ![]() ![]() |
def GetConfigurationVariableNames(self, config_name=None, debug=False): variables = [] project = self.GetProject(debug) if project is not None: for configuration in self.Project.getconfigurations(): if config_name is None or config_name = = configuration.getname(): variables.extend( [var.getname() for var in reduce( lambda x, y: x + y, [ varlist.getvariable() for varlist in configuration.globalVars], [])] ) Return Variables # Replace global resource variables with supplied ones
example 9
source file:estimador.pyVonServer loses deep learning with TensorFlow and AWS LambdacomMY license | 5wishes | ![]() ![]() |
def get_variable_names(self): """Returns the list of all variable names in this model. Returns: List of names. Throws: ValueError: If the estimator has not yet generated a checkpoint. """ _check_checkpoint_disponible(self .model_dir) return [ name by name, _ in training.list_variables(self.model_dir)]
Example 10
source file:vts_converter_tecio.pyVoncell phone scriptscomMY license | 5wishes | ![]() ![]() |
def get_variable_names(pd): var_names = ['x','y','z'] for i in range(pd.GetNumberOfArrays()): arr = pd.GetArray(i) name = arr.GetName() num_components = arr.GetNumberOfComponents() for Component in range(num_components): if num_components == 1: full_name = name else: suffix = ['-X', '-Y', '-Z'] full_name = name+suffix[component]. var_names . append ( full_name ) return var_names
Example 11
source file:PLCControler.pyVonOpenPLC_EditorcomGNU General Public License v3.0 | 5wishes | ![]() ![]() |
def GetProjectPouVariableNames(self, pou_name=None, debug=False): variables = [] project = self.GetProject(debug) if project is not None: for pou in project.getpous(): if pou_name is None or pou_name == pou .getname(): variables.extend([var.Name for var in self.GetPouInterfaceVars(pou, debug=debug)]) para la transición en pou.gettransitionList(): variables.append(transition.getname()) para la acción en pou.getactionList(): variables.append(action.getname()) return variables # Devuelve la ruta del archivo si el proyecto es un archivo abierto
Example 12
source file:rl_tuner_ops.pyVonMagentacomApache License 2.0 | 5wishes | ![]() ![]() |
def get_variable_names(graph, scope): """Finds all variable names in a graph that start with a specified scope. Args: graph: A Tensorflow graph. Scope: A range of strings. Returns: List of variables." "" with chart .as_default(): returns [v.name for v in tf.global_variables() if v.name.startswith(scope)]
Example 13
source file:estimador.pyVonestimatorcomApache License 2.0 | 5wishes | ![]() ![]() |
def get_variable_names(self): """Returns the list of all variable names in this model. Returns: List of names. Throws: ValueError: if `Estimator` has not yet generated a checkpoint. """ _check_checkpoint_available ( self.model_dir ) with context.graph_mode(): returns [name by name, _ in tf.train.list_variables(self.model_dir)]
Example 14
source file:estimador_v2.pyVonbox networkcomGNU General Public License v3.0 | 5wishes | ![]() ![]() |
def get_variable_names(self): """Returns the list of all variable names in this model. Returns: List of names. Throws: ValueError: If the estimator has not yet generated a checkpoint. """ _check_checkpoint_disponible(self .model_dir) return [ name by name, _ in training.list_variables(self.model_dir)]
Example 15
source file:db_access.pyVonBUCEO de back-endcomGNU General Public License v3.0 | 5wishes | ![]() ![]() |
def get_variable_names_by_id(id_list): name_list = [] for variables_id in id_list: name = Field_Properties.query.filter_by(id=variable_id).one().name name_list.append(name) return name_list######### ######## Relacionamentos################
Example 16
source file:xpath_util.pyVonLet me workcomMY license | 4wishes | ![]() ![]() |
def get_variable_names(self,element): "Generate variable names for xpath" # condition to check the length of the 'id' attribute and ignore if there are numbers in the 'id' attribute. Also, ignore ID values with "Input" and "Button" strings. if (element.has_attr('id') and len(element['id'])>2) and bool(re.search(r'\d', element['id'])) == False and (" input" not in element['id'].lower() and "button" not in element['id'].lower()): self.variable_name = element['id'].strip("_" ) # Condition to check if attribute 'value' exists and does not contain any datetime value. elif element.has_attr('value') and element['value'] != '' e bool(re.search(r'([\d]{1,}([/-]|\s|[.] )?)+(\D+)?([/-]|\s|[.])?[[\d]{1,}',element['value']))== False and bool(re. find(r'\d{1,2}[:]\d{1,2}\s+((am|AM|pm|PM)?)',element['value']))==False: # Condition to check if attribute 'type' exists', get value getText() else get attribute 'value' # for all other type attributes, print the values of attribute 'type' + 'value' . Verify that the values of the Value and Type attributes match. if (element.has_attr('type')) and (element['type'] in ('radio','submit','checkbox','search')): if element.getText() !='': self.variable_name = item['type']+ "_" + item.getText().strip().strip("_.") else: self.variable_name = item['type']+ "_" + item ['value'].strip("_.") else: if element['type'].lower() == element['value'].lower(): self.variable_name = element['value']. strip("_.") else: self.variable_name = element['type']+ "_" + element['value'].strip("_.") # condition to check if attribute "name" exists and if the length of the "name" attribute is greater than 2, prints the names of the elif variables element.has_attr('name') and len(element['name'])>2: self.variable_name = element['name' ].strip( " _ ") # Condition to check if the "placeholder" attribute exists and does not contain a number. elif element.has_attr('placeholder') and bool(re.search(r'\d', element['placeholder']))) == False: self.variable_name = element['placeholder'].strip("_ ? *.").encode('ascii',errors='ignore') # Condition to check if attribute "type" exists and not in text','radio','button','checkbox','search ' # and print the name of the elif variable (element.has_attr('type')) and (element['type'] not in ('text','button','radio','checkbox','search') ) : self . variable_name = element['type'] # condition to check if attribute "title" exists elif element.has_attr('title'): self.variable_name = element['title'] # condition to check if attribute "role" exists elif element .has_attr('role') and element['role']!="button": self.variable_name = element['role'] else: self.variable_name = '' return self.variable_name.lower() . replace("+/- ","").replace("| ","").replace(" / ","_"). \ replace("/","_").replace(" - ","_").replace(" ","_").replace("&","").replace("-"," _"). \ replace("[","_").replace("]","").replace(","","").replace("__","_").replace(".com" , "").Area("_")
Example 17
source file:xpath_util.pyVonpage object model qxf2comMY license | 4wishes | ![]() ![]() |
def get_variable_names(self,element): "Generate variable names for xpath" # condition to check the length of the 'id' attribute and ignore if there are numbers in the 'id' attribute. Also, ignore ID values with "Input" and "Button" strings. if (element.has_attr('id') and len(element['id'])>2) and bool(re.search(r'\d', element['id'])) == False and (" input" not in element['id'].lower() and "button" not in element['id'].lower()): self.variable_name = element['id'].strip("_" ) # Condition to check if attribute 'value' exists and does not contain any datetime value. elif element.has_attr('value') and element['value'] != '' e bool(re.search(r'([\d]{1,}([/-]|\s|[.] )?)+(\D+)?([/-]|\s|[.])?[[\d]{1,}',element['value']))== False and bool(re. find(r'\d{1,2}[:]\d{1,2}\s+((am|AM|pm|PM)?)',element['value']))==False: # Condition to check if attribute 'type' exists', get value getText() else get attribute 'value' # for all other type attributes, print the values of attribute 'type' + 'value' . Verify that the values of the Value and Type attributes match. if (element.has_attr('type')) and (element['type'] in ('radio','submit','checkbox','search')): if element.getText() !='': self.variable_name = item['type']+ "_" + item.getText().strip().strip("_.") else: self.variable_name = item['type']+ "_" + item ['value'].strip("_.") else: if element['type'].lower() == element['value'].lower(): self.variable_name = element['value']. strip("_.") else: self.variable_name = element['type']+ "_" + element['value'].strip("_.") # condition to check if attribute "name" exists and if the length of the "name" attribute is greater than 2, prints the names of the elif variables element.has_attr('name') and len(element['name'])>2: self.variable_name = element['name' ].strip( " _ ") # Condition to check if the "placeholder" attribute exists and does not contain a number. elif element.has_attr('placeholder') and bool(re.search(r'\d', element['placeholder']))) == False: self.variable_name = element['placeholder'].strip("_ ? *.").encode('ascii',errors='ignore') # Condition to check if attribute "type" exists and not in text','radio','button','checkbox','search ' # and print the name of the elif variable (element.has_attr('type')) and (element['type'] not in ('text','button','radio','checkbox','search') ) : self . variable_name = element['type'] # condition to check if attribute "title" exists elif element.has_attr('title'): self.variable_name = element['title'] # condition to check if attribute "role" exists elif element .has_attr('role') and element['role']!="button": self.variable_name = element['role'] else: self.variable_name = '' return self.variable_name.lower() . replace("+/- ","").replace("| ","").replace(" / ","_"). \ replace("/","_").replace(" - ","_").replace(" ","_").replace("&","").replace("-"," _"). \ replace("[","_").replace("]","").replace(","","").replace("__","_").replace(".com" , "").Area("_")