tensoreflusso:: ops:: StringSplitV2

#include <string_ops.h>

Dividere gli elementi di source in base a sep in uno SparseTensor .

Riepilogo

Sia N la dimensione della sorgente (tipicamente N sarà la dimensione del batch). Dividi ogni elemento di source in base a sep e restituisci uno SparseTensor contenente i token divisi. I token vuoti vengono ignorati.

Ad esempio, N = 2, source[0] è 'hello world' e source[1] è 'ab c', quindi l'output sarà

st.indices = [0, 0;
              0, 1;
              1, 0;
              1, 1;
              1, 2]
st.shape = [2, 3]
st.values = ['hello', 'world', 'a', 'b', 'c']

Se viene fornito sep , i delimitatori consecutivi non vengono raggruppati insieme e vengono considerati delimitare stringhe vuote. Ad esempio, source di "1\<\>2\<\>\<\>3" e sep di "\<\>" restituiscono ["1", "2", "", "3"] . Se sep è None o una stringa vuota, gli spazi consecutivi vengono considerati come un singolo separatore e il risultato non conterrà stringhe vuote all'inizio o alla fine se la stringa ha spazi iniziali o finali.

Nota che il comportamento sopra menzionato corrisponde a str.split di Python.

Argomenti:

  • scope: un oggetto Scope
  • input: Tensor di stringa 1-D , le stringhe da dividere.
  • sep: stringa 0-D Tensor , il carattere delimitatore.

Attributi facoltativi (vedi Attrs ):

  • maxsplit: un int . Se maxsplit > 0 , limite della suddivisione del risultato.

Ritorna:

Costruttori e distruttori

StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep)
StringSplitV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input sep, const StringSplitV2::Attrs & attrs)

Attributi pubblici

indices
operation
shape
values

Funzioni pubbliche statiche

Maxsplit (int64 x)

Strutture

tensorflow:: ops:: StringSplitV2:: Attrs

Setter di attributi facoltativi per StringSplitV2 .

Attributi pubblici

indici

::tensorflow::Output indices

operazione

Operation operation

forma

::tensorflow::Output shape

valori

::tensorflow::Output values

Funzioni pubbliche

StringSplitV2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep
)

StringSplitV2

 StringSplitV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input sep,
  const StringSplitV2::Attrs & attrs
)

Funzioni pubbliche statiche

Divisione massima

Attrs Maxsplit(
  int64 x
)