Beispiel #1
0
 def _init_set_name(self, name, zero_based=True):
     if not name:
         self._name = backend.unique_object_name(
             generic_utils.to_snake_case(self.__class__.__name__),
             zero_based=zero_based)
     else:
         self._name = name
Beispiel #2
0
 def _make_unique_name(self, name_uid_map=None, avoid_names=None,
                       namespace='', zero_based=False):
   base_name = base_layer.to_snake_case(self.__class__.__name__)
   name = backend.unique_object_name(
       base_name,
       name_uid_map=name_uid_map,
       avoid_names=avoid_names,
       namespace=namespace,
       zero_based=zero_based)
   return (name, base_name)
Beispiel #3
0
 def _make_unique_name(self, name_uid_map=None, avoid_names=None,
                       namespace='', zero_based=False):
   base_name = base_layer.to_snake_case(self.__class__.__name__)
   name = backend.unique_object_name(
       base_name,
       name_uid_map=name_uid_map,
       avoid_names=avoid_names,
       namespace=namespace,
       zero_based=zero_based)
   return (name, base_name)
Beispiel #4
0
 def _get_name(self, prefix):
     # TODO(pulkitb): Move away from `backend.unique_object_name` since it isn't
     # exposed as externally usable.
     return backend.unique_object_name(prefix)