MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _create_resource

Method _create_resource

tensorflow/python/ops/lookup_ops.py:1661–1686  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1659 ops.add_to_collection(ops.GraphKeys.SAVEABLE_OBJECTS, saveable)
1660
1661 def _create_resource(self):
1662 # The table must be shared if checkpointing is requested for multi-worker
1663 # training to work correctly. Use the node name if no shared_name has been
1664 # explicitly specified.
1665 use_node_name_sharing = self._checkpoint and self._shared_name is None
1666 if self._default_value.get_shape().ndims == 0:
1667 table_ref = gen_lookup_ops.mutable_hash_table_v2(
1668 shared_name=self._shared_name,
1669 use_node_name_sharing=use_node_name_sharing,
1670 key_dtype=self._key_dtype,
1671 value_dtype=self._value_dtype,
1672 name=self._name)
1673 else:
1674 table_ref = gen_lookup_ops.mutable_hash_table_of_tensors_v2(
1675 shared_name=self._shared_name,
1676 use_node_name_sharing=use_node_name_sharing,
1677 key_dtype=self._key_dtype,
1678 value_dtype=self._value_dtype,
1679 value_shape=self._default_value.get_shape(),
1680 name=self._name)
1681
1682 if context.executing_eagerly():
1683 self._table_name = None
1684 else:
1685 self._table_name = table_ref.op.name.split("/")[-1]
1686 return table_ref
1687
1688 @property
1689 def name(self):

Callers 1

__init__Method · 0.95

Calls 3

executing_eagerlyMethod · 0.80
get_shapeMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected