예제 #1
0
    def insert(self, keys, values, name=None):
        """Associates `keys` with `values`.

    Args:
      keys: Keys to insert. Can be a tensor of any shape. Must match the
        table's key type.
      values: Values to be associated with keys. Must be a tensor of the same
        shape as `keys` and match the table's value type.
      name: A name for the operation (optional).

    Returns:
      The created Operation.

    Raises:
      TypeError: when `keys` or `values` doesn't match the table data
        types.
    """
        self._check_table_dtypes(keys.dtype, values.dtype)
        with ops.name_scope(name, "%s_lookup_table_insert" % self._name,
                            [self._table_ref, keys, values]) as name:
            # pylint: disable=protected-access
            op = gen_data_flow_ops._lookup_table_insert(self._table_ref,
                                                        keys,
                                                        values,
                                                        name=name)
            return op
예제 #2
0
  def insert(self, keys, values, name=None):
    """Associates `keys` with `values`.

    Args:
      keys: Keys to insert. Can be a tensor of any shape. Must match the
        table's key type.
      values: Values to be associated with keys. Must be a tensor of the same
        shape as `keys` and match the table's value type.
      name: A name for the operation (optional).

    Returns:
      The created Operation.

    Raises:
      TypeError: when `keys` or `values` doesn't match the table data
        types.
    """
    self._check_table_dtypes(keys.dtype, values.dtype)
    with ops.name_scope(name, "%s_lookup_table_insert" % self._name,
                        [self._table_ref, keys, values]) as name:
      # pylint: disable=protected-access
      op = gen_data_flow_ops._lookup_table_insert(
          self._table_ref, keys, values, name=name)
      # pylint: enable=protected-access

    return op
예제 #3
0
 def insert(self, keys, values):
   return gen_data_flow_ops._lookup_table_insert(self.table_ref, keys, values)
예제 #4
0
 def insert(self, keys, values):
     return gen_data_flow_ops._lookup_table_insert(self.table_ref, keys,
                                                   values)