Avviso: questa API è obsoleta e verrà rimossa in una versione futura di TensorFlow dopo che la sostituzione sarà stabile.
Output
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Un handle simbolico per un tensore prodotto da un Operation
.
Un Output<T>
è un handle simbolico per un Tensor<T>
. Il valore del tensore viene calcolato eseguendo l' Operation
in una Session
.
Implementando l'interfaccia Operand
, le istanze di questa classe fungono anche da operandi per le istanze Op
.
Metodi pubblici
Uscita <T> | comeuscita () Restituisce la maniglia simbolica di un tensore. |
Tipo di dati | tipo di dati () Restituisce il DataType del tensore a cui fa riferimento questo Output. |
booleano | |
int | |
int | indice () Restituisce l'indice negli output dell'operazione. |
Operazione | operazione () Restituisce l'operazione che produrrà il tensore a cui fa riferimento questo output. |
Forma | forma () Restituisce la forma (possibilmente parzialmente conosciuta) del tensore a cui fa riferimento questo Output. |
Tensore <T> | tensore () Restituisce il tensore in questo output. |
Corda | |
Metodi ereditati
Dalla classe java.lang.Object booleano | è uguale a (Oggetto arg0) |
Classe finale<?> | getClass () |
int | codice hash () |
vuoto finale | notificare () |
vuoto finale | notificaTutti () |
Corda | accordare () |
vuoto finale | attendere (lungo arg0, int arg1) |
vuoto finale | aspetta (lungo arg0) |
vuoto finale | Aspettare () |
Metodi pubblici
Uscita pubblica <T> asOutput ()
Restituisce la maniglia simbolica di un tensore.
Gli input per le operazioni TensorFlow sono output di un'altra operazione TensorFlow. Questo metodo viene utilizzato per ottenere un handle simbolico che rappresenta il calcolo dell'input.
public DataType dataType ()
Restituisce il DataType del tensore a cui fa riferimento questo Output.
booleano pubblico è uguale a (Oggetto o)
indice int pubblico ()
Restituisce l'indice negli output dell'operazione.
Restituisce l'operazione che produrrà il tensore a cui fa riferimento questo output.
forma pubblica forma ()
Restituisce la forma (possibilmente parzialmente conosciuta) del tensore a cui fa riferimento questo Output.
tensore pubblico <T> tensore ()
Restituisce il tensore in questo output.
Questa operazione è supportata solo sugli output di un'operazione eseguita con entusiasmo. Per gli ambienti grafici, i tensori di output devono essere recuperati eseguendo una sessione, utilizzando Session.Runner.fetch(Output)
.
Lancia
IllegalStateException | se questo output risulta da un grafico |
---|
stringa pubblica toString ()
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[],[],null,["# Output\n\npublic final class **Output** \nA symbolic handle to a tensor produced by an [Operation](/api_docs/java/org/tensorflow/Operation).\n\nAn `Output<T>` is a symbolic handle to a `Tensor<T>`. The value of the tensor is\ncomputed by executing the [Operation](/api_docs/java/org/tensorflow/Operation) in a [Session](/api_docs/java/org/tensorflow/Session).\n\nBy implementing the [Operand](/api_docs/java/org/tensorflow/Operand) interface, instances of this class also act as operands to\n[Op](/api_docs/java/org/tensorflow/op/Op) instances.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [asOutput](/api_docs/java/org/tensorflow/Output#asOutput())() Returns the symbolic handle of a tensor. |\n| [DataType](/api_docs/java/org/tensorflow/DataType) | [dataType](/api_docs/java/org/tensorflow/Output#dataType())() Returns the DataType of the tensor referred to by this Output. |\n| boolean | [equals](/api_docs/java/org/tensorflow/Output#equals(java.lang.Object))(Object o) |\n| int | [hashCode](/api_docs/java/org/tensorflow/Output#hashCode())() |\n| int | [index](/api_docs/java/org/tensorflow/Output#index())() Returns the index into the outputs of the Operation. |\n| [Operation](/api_docs/java/org/tensorflow/Operation) | [op](/api_docs/java/org/tensorflow/Output#op())() Returns the Operation that will produce the tensor referred to by this Output. |\n| [Shape](/api_docs/java/org/tensorflow/Shape) | [shape](/api_docs/java/org/tensorflow/Output#shape())() Returns the (possibly partially known) shape of the tensor referred to by this Output. |\n| [Tensor](/api_docs/java/org/tensorflow/Tensor)\\\u003cT\\\u003e | [tensor](/api_docs/java/org/tensorflow/Output#tensor())() Returns the tensor at this output. |\n| String | [toString](/api_docs/java/org/tensorflow/Output#toString())() |\n\n### Inherited Methods\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\nFrom interface [org.tensorflow.Operand](/api_docs/java/org/tensorflow/Operand) \n\n|--------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| abstract [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [asOutput](/api_docs/java/org/tensorflow/Operand#asOutput())() Returns the symbolic handle of a tensor. |\n\nPublic Methods\n--------------\n\n#### public [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\n**asOutput**\n()\n\nReturns the symbolic handle of a tensor.\n\nInputs to TensorFlow operations are outputs of another TensorFlow operation. This method is\nused to obtain a symbolic handle that represents the computation of the input.\n\n\u003cbr /\u003e\n\n#### public [DataType](/api_docs/java/org/tensorflow/DataType)\n**dataType**\n()\n\nReturns the DataType of the tensor referred to by this Output. \n\n#### public boolean\n**equals**\n(Object o)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| o | |\n|---|---|\n\n#### public int\n**hashCode**\n()\n\n\u003cbr /\u003e\n\n#### public int\n**index**\n()\n\nReturns the index into the outputs of the Operation. \n\n#### public [Operation](/api_docs/java/org/tensorflow/Operation)\n**op**\n()\n\nReturns the Operation that will produce the tensor referred to by this Output. \n\n#### public [Shape](/api_docs/java/org/tensorflow/Shape)\n**shape**\n()\n\nReturns the (possibly partially known) shape of the tensor referred to by this Output. \n\n#### public [Tensor](/api_docs/java/org/tensorflow/Tensor)\\\u003cT\\\u003e\n**tensor**\n()\n\nReturns the tensor at this output.\n\nThis operation is only supported on the outputs of an operation executed eagerly. For graph\nenvironments, output tensors must be fetched by running a session, using [Session.Runner.fetch(Output)](/api_docs/java/org/tensorflow/Session.Runner#fetch(org.tensorflow.Output\u003c?\u003e)).\n\n\u003cbr /\u003e\n\n##### Returns\n\n- tensor \n\n##### Throws\n\n| IllegalStateException | if this output results from a graph |\n|-----------------------|-------------------------------------|\n\n##### See Also\n\n- [EagerSession](/api_docs/java/org/tensorflow/EagerSession) \n\n#### public String\n**toString**\n()\n\n\u003cbr /\u003e"]]