parameters: (variable, collections_set, collections_name)
docstring: Adds variable (or all its parts) to all collections with that name.
docstring_summary: Adds variable (or all its parts) to all collections with that name.
docstring_tokens: Adds variable ( or all its parts ) to all collections with that name .
function: def _add_variable_to_collections(variable, collections_set, collections_name):
    """Adds variable (or all its parts) to all collections with that name."""
    collections = utils.get_variable_collections(
        collections_set, collections_name) or []
    variables_list = [variable]
    if isinstance(variable, tf_variables.PartitionedVariable):
      variables_list = [v for v in variable]
    for collection in collections:
      for var in variables_list:
        if var not in ops.get_collection(collection):
          ops.add_to_collection(collection, var)
function_tokens: def _add_variable_to_collections ( variable , collections_set , collections_name ) : collections = utils . get_variable_collections ( collections_set , collections_name ) or [ ] variables_list = [ variable ] if isinstance ( variable , tf_variables . PartitionedVariable ) : variables_list = [ v for v in variable ] for collection in collections : for var in variables_list : if var not in ops . get_collection ( collection ) : ops . add_to_collection ( collection , var )