fluxo tensor:: ops:: Ponto Dinâmico Paralelo

#include <data_flow_ops.h>

Intercale os valores dos tensores data em um único tensor.

Resumo

Constrói um tensor mesclado tal que

    merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]

Por exemplo, se cada indices[m] for escalar ou vetorial, temos

    # Scalar indices:
    merged
[indices[m], ...] = data[m][...]

    # Vector indices:
    merged
[indices[m][i], ...] = data[m][i, ...]

Cada data[i].shape deve começar com os indices[i].shape , e o restante de data[i].shape deve ser constante em relação a i . Ou seja, devemos ter data[i].shape = indices[i].shape + constant . Em termos desta constant , a forma de saída é

merged.shape = [max(indices)] + constant

Os valores podem ser mesclados em paralelo, portanto, se um índice aparecer em ambos indices[m][i] e indices[n][j] , o resultado poderá ser inválido. Isso difere do operador DynamicStitch normal que define o comportamento nesse caso.

Por exemplo:

    indices[0] = 6
    indices
[1] = [4, 1]
    indices
[2] = [[5, 2], [0, 3]]
    data
[0] = [61, 62]
    data
[1] = [[41, 42], [11, 12]]
    data
[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
    merged
= [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
             
[51, 52], [61, 62]]

Este método pode ser usado para mesclar partições criadas por dynamic_partition conforme ilustrado no exemplo a seguir:

    # Apply function (increments x_i) on elements for which a certain condition
   
# apply (x_i != -1 in this example).
    x
=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
    condition_mask
=tf.not_equal(x,tf.constant(-1.))
    partitioned_data
= tf.dynamic_partition(
        x
, tf.cast(condition_mask, tf.int32) , 2)
    partitioned_data
[1] = partitioned_data[1] + 1.0
    condition_indices
= tf.dynamic_partition(
        tf
.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)
    x
= tf.dynamic_stitch(condition_indices, partitioned_data)
   
# Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
   
# unchanged.

Argumentos:

Retorna:

Construtores e Destruidores

ParallelDynamicStitch (const :: tensorflow::Scope & scope, :: tensorflow::InputList indices, :: tensorflow::InputList data)

Atributos públicos

merged
operation

Funções públicas

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Atributos públicos

mesclado

::tensorflow::Output merged

operação

Operation operation

Funções públicas

Ponto Dinâmico Paralelo

 ParallelDynamicStitch(
 
const ::tensorflow::Scope & scope,
 
::tensorflow::InputList indices,
 
::tensorflow::InputList data
)

::tensorflow::Node * node() const 

operador::tensorflow::Input

 operator::tensorflow::Input() const 

operador::tensorflow::Saída

 operator::tensorflow::Output() const