Operation
bookmark_borderbookmark
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Sottoclassi indirette conosciute |
Esegue calcoli sui tensori.
Un'operazione richiede zero o più Tensor
(prodotti da altre operazioni) come input e produce zero o più Tensor
come output.
Metodi pubblici
astratto int | inputListLength (nome stringa) Restituisce la dimensione dell'elenco di tensori fornito per questa operazione. |
stringa astratta | nome () Restituisce il nome completo dell'operazione. |
astratto int | numeroUscite () Restituisce il numero di tensori prodotti da questa operazione. |
astratto <T> Risultato <T> | output (int idx) Restituisce un handle simbolico a uno dei tensori prodotti da questa operazione. |
output astratto[] <?> | outputList (int idx, int lunghezza) Restituisce gli handle simbolici a un elenco di tensori prodotti da questa operazione. |
astratto int | outputListLength (nome stringa) Restituisce la dimensione dell'elenco di Tensori prodotto da questa operazione. |
stringa astratta | tipo () Restituisce il tipo dell'operazione, ovvero il nome del calcolo eseguito dall'operazione. |
Metodi pubblici
Restituisce la dimensione dell'elenco di tensori fornito per questa operazione.
Un'operazione ha più input denominati, ognuno dei quali contiene un singolo tensore o un elenco di tensori. Questo metodo restituisce la dimensione dell'elenco di tensori per un input denominato specifico dell'operazione.
Parametri
nome | identificatore dell'elenco di tensori (di cui possono essere molti) input per questa operazione. |
---|
ritorna
- la dimensione dell'elenco di tensori prodotto da questo input denominato.
Lancia
IllegalArgumentException | se questa operazione non ha input con il nome fornito. |
---|
nome stringa astratta pubblica ()
Restituisce il nome completo dell'operazione.
public abstract int numOutputs ()
Restituisce il numero di tensori prodotti da questa operazione.
public abstract Output <T> output (int idx)
Restituisce un handle simbolico a uno dei tensori prodotti da questa operazione.
Attenzione: non controlla che il tipo del tensore corrisponda a T. Si consiglia di chiamare questo metodo con un parametro di tipo esplicito anziché lasciarlo dedurre, ad esempio operation.<Integer>output(0)
Parametri
idx | L'indice dell'output tra gli output prodotti da questa operazione. |
---|
public abstract Output[] <?> outputList (int idx, int length)
Restituisce gli handle simbolici a un elenco di tensori prodotti da questa operazione.
Parametri
idx | indice del primo tensore della lista |
---|
lunghezza | numero di tensori nell'elenco |
---|
public abstract int outputListLength (nome stringa)
Restituisce la dimensione dell'elenco di Tensori prodotto da questa operazione.
Un'operazione ha più output denominati, ognuno dei quali produce un singolo tensore o un elenco di tensori. Questo metodo restituisce la dimensione dell'elenco di tensori per un output denominato specifico dell'operazione.
Parametri
nome | identificatore dell'elenco di tensori (che possono essere molti) prodotto da questa operazione. |
---|
ritorna
- la dimensione dell'elenco di tensori prodotto da questo output denominato.
Lancia
IllegalArgumentException | se questa operazione non ha output con il nome fornito. |
---|
tipo stringa astratta pubblica ()
Restituisce il tipo dell'operazione, ovvero il nome del calcolo eseguito dall'operazione.
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. Alcuni contenuti sono concessi in base alla licenza NumPy.
Ultimo aggiornamento 2025-07-27 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-27 UTC."],[],[],null,["# Operation\n\npublic interface **Operation** \n\n|---|---|---|\n| Known Indirect Subclasses [GraphOperation](/versions/r2.12/api_docs/java/org/tensorflow/GraphOperation) |-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [GraphOperation](/versions/r2.12/api_docs/java/org/tensorflow/GraphOperation) | Implementation for an [Operation](/versions/r2.12/api_docs/java/org/tensorflow/Operation) added as a node to a [Graph](/versions/r2.12/api_docs/java/org/tensorflow/Graph). | |||\n\nPerforms computation on Tensors.\n\nAn Operation takes zero or more [Tensor](/versions/r2.12/api_docs/java/org/tensorflow/Tensor)s (produced by other Operations) as input, and\nproduces zero or more [Tensor](/versions/r2.12/api_docs/java/org/tensorflow/Tensor)s as output.\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [inputListLength](/versions/r2.12/api_docs/java/org/tensorflow/Operation#inputListLength(java.lang.String))(String name) Returns the size of the given inputs list of Tensors for this operation. |\n| abstract String | [name](/versions/r2.12/api_docs/java/org/tensorflow/Operation#name())() Returns the full name of the Operation. |\n| abstract int | [numOutputs](/versions/r2.12/api_docs/java/org/tensorflow/Operation#numOutputs())() Returns the number of tensors produced by this operation. |\n| abstract \\\u003cT\\\u003e [Output](/versions/r2.12/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [output](/versions/r2.12/api_docs/java/org/tensorflow/Operation#output(int))(int idx) Returns a symbolic handle to one of the tensors produced by this operation. |\n| abstract [Output\\[\\]](/versions/r2.12/api_docs/java/org/tensorflow/Output)\\\u003c?\\\u003e | [outputList](/versions/r2.12/api_docs/java/org/tensorflow/Operation#outputList(int,%20int))(int idx, int length) Returns symbolic handles to a list of tensors produced by this operation. |\n| abstract int | [outputListLength](/versions/r2.12/api_docs/java/org/tensorflow/Operation#outputListLength(java.lang.String))(String name) Returns the size of the list of Tensors produced by this operation. |\n| abstract String | [type](/versions/r2.12/api_docs/java/org/tensorflow/Operation#type())() Returns the type of the operation, i.e., the name of the computation performed by the operation. |\n\nPublic Methods\n--------------\n\n#### public abstract int\n**inputListLength**\n(String name)\n\nReturns the size of the given inputs list of Tensors for this operation.\n\nAn Operation has multiple named inputs, each of which contains either a single tensor or a\nlist of tensors. This method returns the size of the list of tensors for a specific named input\nof the operation.\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| name | identifier of the list of tensors (of which there may be many) inputs to this operation. |\n|------|------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- the size of the list of Tensors produced by this named input. \n\n##### Throws\n\n| IllegalArgumentException | if this operation has no input with the provided name. |\n|--------------------------|--------------------------------------------------------|\n\n#### public abstract String\n**name**\n()\n\nReturns the full name of the Operation. \n\n#### public abstract int\n**numOutputs**\n()\n\nReturns the number of tensors produced by this operation. \n\n#### public abstract [Output](/versions/r2.12/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e\n**output**\n(int idx)\n\nReturns a symbolic handle to one of the tensors produced by this operation.\n\nWarning: Does not check that the type of the tensor matches T. It is recommended to call\nthis method with an explicit type parameter rather than letting it be inferred, e.g. `operation.<Integer>output(0)`\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| idx | The index of the output among the outputs produced by this operation. |\n|-----|-----------------------------------------------------------------------|\n\n#### public abstract [Output\\[\\]](/versions/r2.12/api_docs/java/org/tensorflow/Output)\\\u003c?\\\u003e\n**outputList**\n(int idx, int length)\n\nReturns symbolic handles to a list of tensors produced by this operation. \n\n##### Parameters\n\n| idx | index of the first tensor of the list |\n| length | number of tensors in the list |\n|--------|---------------------------------------|\n\n##### Returns\n\n- array of `Output` \n\n#### public abstract int\n**outputListLength**\n(String name)\n\nReturns the size of the list of Tensors produced by this operation.\n\nAn Operation has multiple named outputs, each of which produces either a single tensor or a\nlist of tensors. This method returns the size of the list of tensors for a specific named\noutput of the operation.\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| name | identifier of the list of tensors (of which there may be many) produced by this operation. |\n|------|--------------------------------------------------------------------------------------------|\n\n##### Returns\n\n- the size of the list of Tensors produced by this named output. \n\n##### Throws\n\n| IllegalArgumentException | if this operation has no output with the provided name. |\n|--------------------------|---------------------------------------------------------|\n\n#### public abstract String\n**type**\n()\n\nReturns the type of the operation, i.e., the name of the computation performed by the\noperation."]]