Ejemplo n.º 1
0
  def export(self, name=None):
    """Returns tensors of all keys and values in the table.

    Args:
      name: A name for the operation (optional).

    Returns:
      A pair of tensors with the first tensor containing all keys and the
        second tensors containing all values in the table.
    """
    with ops.name_scope(name, "%s_lookup_table_export_values" % self._name,
                        [self._table_ref]) as name:
      with ops.colocate_with(self._table_ref):
        # pylint: disable=protected-access
        exported_keys, exported_values = gen_lookup_ops._lookup_table_export_v2(
            self._table_ref, self._key_dtype, self._value_dtype, name=name)

    exported_values.set_shape(exported_keys.get_shape().concatenate(
        self._value_shape))
    return exported_keys, exported_values
Ejemplo n.º 2
0
 def _export(self):
     return gen_lookup_ops._lookup_table_export_v2(self.table_ref,
                                                   dtypes.string,
                                                   dtypes.float32)
Ejemplo n.º 3
0
 def _export(self):
   return gen_lookup_ops._lookup_table_export_v2(self.table_ref, dtypes.string,
                                                 dtypes.float32)