RaggedGather

public final class RaggedGather

Raccogli sezioni irregolari dall'asse "0" di "params" in base a "indici".

Restituisce un output `RaggedTensor` composto da` output_dense_values` e `output_nested_splits`, tale che:

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]
 
dove
  • `params = ragged.from_nested_row_splits (params_dense_values, params_nested_splits)` fornisce i valori che dovrebbero essere raccolti.
  • `indices` ia un tensore denso con dtype` int32` o `int64`, che indica quali valori dovrebbero essere raccolti.
  • `output = ragged.from_nested_row_splits (output_dense_values, output_nested_splits)` è il tensore di output.
(Nota: questo op c ++ è usato per implementare l'opera python di livello superiore `tf.ragged.gather`, che supporta anche indici irregolari.)

Metodi pubblici

static <T estende il numero, U, V estende il numero> RaggedGather <T, U>
create ( Scope scope, Iterable < Operand <T>> paramsNestedSplits, Operand <U> paramsDenseValues, Operand <V> indici, Long OUTPUTRAGGEDRANK)
Metodo Factory per creare una classe che avvolge una nuova operazione RaggedGather.
Uscita <U>
outputDenseValues ()
I `flat_values` per il RaggedTensor restituito.
Elenco < Uscita <T>>
outputNestedSplits ()
I tensori `nested_row_splits` che definiscono il partizionamento delle righe per il RaggedTensor restituito.

Metodi ereditati

Metodi pubblici

public static RaggedGather <T, U> create ( Scope scope, Iterable < Operand <T>> paramsNestedSplits, Operand <U> paramsDenseValues, Operand <V> indices, Long OUTPUTRAGGEDRANK)

Metodo Factory per creare una classe che avvolge una nuova operazione RaggedGather.

Parametri
scopo ambito attuale
paramsNestedSplits I tensori `nested_row_splits` che definiscono il partizionamento delle righe per l'input RaggedTensor` params`.
paramsDenseValues I `flat_values` per il` params` RaggedTensor. C'è stata una modifica terminologica a livello di python da dense_values ​​a flat_values, quindi dense_values ​​è il nome deprecato.
indici Indici nella dimensione più esterna di "parametri" dei valori che dovrebbero essere raccolti.
OUTPUTRAGGEDRANK Il rango irregolare dell'output RaggedTensor. `output_nested_splits` conterrà questo numero di tensori` row_splits`. Questo valore dovrebbe essere uguale a `indices.shape.ndims + params.ragged_rank - 1`.
ritorna
  • una nuova istanza di RaggedGather

output pubblico <U> outputDenseValues ()

I `flat_values` per il RaggedTensor restituito.

public List < Output <T>> outputNestedSplits ()

I tensori `nested_row_splits` che definiscono il partizionamento delle righe per il RaggedTensor restituito.