tf.raw_ops.DenseToSparseSetOperation
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Applies set operation along last dimension of Tensor
and SparseTensor
.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.raw_ops.DenseToSparseSetOperation
tf.raw_ops.DenseToSparseSetOperation(
set1,
set2_indices,
set2_values,
set2_shape,
set_operation,
validate_indices=True,
name=None
)
See SetOperationOp::SetOperationFromContext for values of set_operation
.
Input set2
is a SparseTensor
represented by set2_indices
, set2_values
,
and set2_shape
. For set2
ranked n
, 1st n-1
dimensions must be the same
as set1
. Dimension n
contains values in a set, duplicates are allowed but
ignored.
If validate_indices
is True
, this op validates the order and range of set2
indices.
Output result
is a SparseTensor
represented by result_indices
,
result_values
, and result_shape
. For set1
and set2
ranked n
, this
has rank n
and the same 1st n-1
dimensions as set1
and set2
. The nth
dimension contains the result of set_operation
applied to the corresponding
[0...n-1]
dimension of set
.
Args |
set1
|
A Tensor . Must be one of the following types: int8 , int16 , int32 , int64 , uint8 , uint16 , string .
Tensor with rank n . 1st n-1 dimensions must be the same as set2 .
Dimension n contains values in a set, duplicates are allowed but ignored.
|
set2_indices
|
A Tensor of type int64 .
2D Tensor , indices of a SparseTensor . Must be in row-major
order.
|
set2_values
|
A Tensor . Must have the same type as set1 .
1D Tensor , values of a SparseTensor . Must be in row-major
order.
|
set2_shape
|
A Tensor of type int64 .
1D Tensor , shape of a SparseTensor . set2_shape[0...n-1] must
be the same as the 1st n-1 dimensions of set1 , result_shape[n] is the
max set size across n-1 dimensions.
|
set_operation
|
A string .
|
validate_indices
|
An optional bool . Defaults to True .
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (result_indices, result_values, result_shape).
|
result_indices
|
A Tensor of type int64 .
|
result_values
|
A Tensor . Has the same type as set1 .
|
result_shape
|
A Tensor of type int64 .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.DenseToSparseSetOperation\n\n\u003cbr /\u003e\n\nApplies set operation along last dimension of `Tensor` and `SparseTensor`.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.DenseToSparseSetOperation`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/DenseToSparseSetOperation)\n\n\u003cbr /\u003e\n\n tf.raw_ops.DenseToSparseSetOperation(\n set1,\n set2_indices,\n set2_values,\n set2_shape,\n set_operation,\n validate_indices=True,\n name=None\n )\n\nSee SetOperationOp::SetOperationFromContext for values of `set_operation`.\n\nInput `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`,\nand `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same\nas `set1`. Dimension `n` contains values in a set, duplicates are allowed but\nignored.\n\nIf `validate_indices` is `True`, this op validates the order and range of `set2`\nindices.\n\nOutput `result` is a `SparseTensor` represented by `result_indices`,\n`result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this\nhas rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth`\ndimension contains the result of `set_operation` applied to the corresponding\n`[0...n-1]` dimension of `set`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `set1` | A `Tensor`. Must be one of the following types: `int8`, `int16`, `int32`, `int64`, `uint8`, `uint16`, `string`. `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. Dimension `n` contains values in a set, duplicates are allowed but ignored. |\n| `set2_indices` | A `Tensor` of type `int64`. 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major order. |\n| `set2_values` | A `Tensor`. Must have the same type as `set1`. 1D `Tensor`, values of a `SparseTensor`. Must be in row-major order. |\n| `set2_shape` | A `Tensor` of type `int64`. 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must be the same as the 1st `n-1` dimensions of `set1`, `result_shape[n]` is the max set size across `n-1` dimensions. |\n| `set_operation` | A `string`. |\n| `validate_indices` | An optional `bool`. Defaults to `True`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|------------------|------------------------------------------|\n| A tuple of `Tensor` objects (result_indices, result_values, result_shape). ||\n| `result_indices` | A `Tensor` of type `int64`. |\n| `result_values` | A `Tensor`. Has the same type as `set1`. |\n| `result_shape` | A `Tensor` of type `int64`. |\n\n\u003cbr /\u003e"]]