Warning: This API is deprecated and will be removed in a future
version of TensorFlow after
the replacement is stable.
RaggedGather
Stay organized with collections
Save and categorize content based on your preferences.
Gather ragged slices from `params` axis `0` according to `indices`.
Outputs a `RaggedTensor` output composed from `output_dense_values` and
`output_nested_splits`, such that:
output.shape = indices.shape + params.shape[1:]
output.ragged_rank = indices.shape.ndims + params.ragged_rank
output[i...j, d0...dn] = params[indices[i...j], d0...dn]
where
-
`params =
ragged.from_nested_row_splits(params_dense_values, params_nested_splits)`
provides the values that should be gathered.
-
`indices` ia a dense tensor with dtype `int32` or `int64`, indicating which
values should be gathered.
-
`output =
ragged.from_nested_row_splits(output_dense_values, output_nested_splits)`
is the output tensor.
(Note: This c++ op is used to implement the higher-level python
`tf.ragged.gather` op, which also supports ragged indices.)
Public Methods
static
<T extends Number, U, V extends Number>
RaggedGather<T, U>
|
create( Scope scope, Iterable< Operand<T>> paramsNestedSplits, Operand<U> paramsDenseValues, Operand<V> indices, Long OUTPUTRAGGEDRANK)
Factory method to create a class wrapping a new RaggedGather operation.
|
Output<U>
|
|
List<Output<T>>
|
outputNestedSplits()
The `nested_row_splits` tensors that define the row-partitioning for the
returned RaggedTensor.
|
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Public Methods
public
static
RaggedGather<T, U>
create
(Scope scope, Iterable<Operand<T>> paramsNestedSplits, Operand<U> paramsDenseValues, Operand<V> indices, Long OUTPUTRAGGEDRANK)
Factory method to create a class wrapping a new RaggedGather operation.
Parameters
scope |
current scope |
paramsNestedSplits |
The `nested_row_splits` tensors that define the row-partitioning for the
`params` RaggedTensor input. |
paramsDenseValues |
The `flat_values` for the `params` RaggedTensor. There was a terminology change
at the python level from dense_values to flat_values, so dense_values is the
deprecated name. |
indices |
Indices in the outermost dimension of `params` of the values that should be
gathered. |
OUTPUTRAGGEDRANK |
The ragged rank of the output RaggedTensor. `output_nested_splits` will contain
this number of `row_splits` tensors. This value should equal
`indices.shape.ndims + params.ragged_rank - 1`. |
Returns
- a new instance of RaggedGather
public
Output<U>
outputDenseValues
()
The `flat_values` for the returned RaggedTensor.
public
List<Output<T>>
outputNestedSplits
()
The `nested_row_splits` tensors that define the row-partitioning for the
returned RaggedTensor.
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.
Last updated 2022-02-12 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 2022-02-12 UTC."],[],[],null,["# RaggedGather\n\npublic final class **RaggedGather** \nGather ragged slices from \\`params\\` axis \\`0\\` according to \\`indices\\`.\n\n\nOutputs a \\`RaggedTensor\\` output composed from \\`output_dense_values\\` and\n\\`output_nested_splits\\`, such that: \n\n output.shape = indices.shape + params.shape[1:]\n output.ragged_rank = indices.shape.ndims + params.ragged_rank\n output[i...j, d0...dn] = params[indices[i...j], d0...dn]\n \nwhere\n\n- \\`params = ragged.from_nested_row_splits(params_dense_values, params_nested_splits)\\` provides the values that should be gathered.\n- \\`indices\\` ia a dense tensor with dtype \\`int32\\` or \\`int64\\`, indicating which values should be gathered.\n- \\`output = ragged.from_nested_row_splits(output_dense_values, output_nested_splits)\\` is the output tensor.\n\n(Note: This c++ op is used to implement the higher-level python \\`tf.ragged.gather\\` op, which also supports ragged indices.)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static \\\u003cT extends Number, U, V extends Number\\\u003e [RaggedGather](/api_docs/java/org/tensorflow/op/core/RaggedGather)\\\u003cT, U\\\u003e | [create](/api_docs/java/org/tensorflow/op/core/RaggedGather#create(org.tensorflow.op.Scope,%20java.lang.Iterable\u003corg.tensorflow.Operand\u003cT\u003e\u003e,%20org.tensorflow.Operand\u003cU\u003e,%20org.tensorflow.Operand\u003cV\u003e,%20java.lang.Long))([Scope](/api_docs/java/org/tensorflow/op/Scope) scope, Iterable\\\u003c[Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e\\\u003e paramsNestedSplits, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cU\\\u003e paramsDenseValues, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cV\\\u003e indices, Long OUTPUTRAGGEDRANK) Factory method to create a class wrapping a new RaggedGather operation. |\n| [Output](/api_docs/java/org/tensorflow/Output)\\\u003cU\\\u003e | [outputDenseValues](/api_docs/java/org/tensorflow/op/core/RaggedGather#outputDenseValues())() The \\`flat_values\\` for the returned RaggedTensor. |\n| List\\\u003c[Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\\\u003e | [outputNestedSplits](/api_docs/java/org/tensorflow/op/core/RaggedGather#outputNestedSplits())() The \\`nested_row_splits\\` tensors that define the row-partitioning for the returned RaggedTensor. |\n\n### Inherited Methods\n\nFrom class [org.tensorflow.op.PrimitiveOp](/api_docs/java/org/tensorflow/op/PrimitiveOp) \n\n|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| final boolean | [equals](/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |\n| final int | [hashCode](/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |\n| [Operation](/api_docs/java/org/tensorflow/Operation) | [op](/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying [Operation](/api_docs/java/org/tensorflow/Operation) |\n| final String | [toString](/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public static [RaggedGather](/api_docs/java/org/tensorflow/op/core/RaggedGather)\\\u003cT, U\\\u003e\n**create**\n([Scope](/api_docs/java/org/tensorflow/op/Scope) scope, Iterable\\\u003c[Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cT\\\u003e\\\u003e paramsNestedSplits, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cU\\\u003e paramsDenseValues, [Operand](/api_docs/java/org/tensorflow/Operand)\\\u003cV\\\u003e indices, Long OUTPUTRAGGEDRANK)\n\nFactory method to create a class wrapping a new RaggedGather operation. \n\n##### Parameters\n\n| scope | current scope |\n| paramsNestedSplits | The \\`nested_row_splits\\` tensors that define the row-partitioning for the \\`params\\` RaggedTensor input. |\n| paramsDenseValues | The \\`flat_values\\` for the \\`params\\` RaggedTensor. There was a terminology change at the python level from dense_values to flat_values, so dense_values is the deprecated name. |\n| indices | Indices in the outermost dimension of \\`params\\` of the values that should be gathered. |\n| OUTPUTRAGGEDRANK | The ragged rank of the output RaggedTensor. \\`output_nested_splits\\` will contain this number of \\`row_splits\\` tensors. This value should equal \\`indices.shape.ndims + params.ragged_rank - 1\\`. |\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- a new instance of RaggedGather \n\n#### public [Output](/api_docs/java/org/tensorflow/Output)\\\u003cU\\\u003e\n**outputDenseValues**\n()\n\nThe \\`flat_values\\` for the returned RaggedTensor. \n\n#### public List\\\u003c[Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\\\u003e\n**outputNestedSplits**\n()\n\nThe \\`nested_row_splits\\` tensors that define the row-partitioning for the\nreturned RaggedTensor."]]