GraphOperation
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Implementacja Operation
dodana jako węzeł do Graph
.
Instancje GraphOperation są ważne tylko wtedy, gdy Graph
, którego są częścią, jest prawidłowe. Zatem jeśli zostanie wywołana funkcja Graph.close()
, wówczas metody w instancji GraphOperation mogą zakończyć się niepowodzeniem z powodu IllegalStateException
.
Instancje GraphOperation są niezmienne i bezpieczne dla wątków.
Metody publiczne
wartość logiczna | |
wew | |
wew | inputListLength (nazwa ciągu) Zwraca rozmiar podanej listy wejściowej tensorów dla tej operacji. |
Strunowy | nazwa () Zwraca pełną nazwę operacji. |
wew | liczba wyjść () Zwraca liczbę tensorów wytworzonych w wyniku tej operacji. |
<T> Wyjście <T> | wynik (int idx) Zwraca symboliczny uchwyt do jednego z tensorów utworzonych w wyniku tej operacji. |
Wyjście[] <?> | lista wyjściowa (int idx, int długość) Zwraca uchwyty symboliczne do listy tensorów utworzonych w wyniku tej operacji. |
wew | OutputListLength (nazwa ciągu) Zwraca rozmiar listy tensorów utworzonej w wyniku tej operacji. |
Strunowy | |
Strunowy | typ () Zwraca typ operacji, tj. nazwę obliczenia wykonywanego przez operację. |
Metody dziedziczone
Z klasy java.lang.Object wartość logiczna | równa się (Obiekt arg0) |
ostatnia klasa<?> | pobierzKlasę () |
wew | hashCode () |
ostateczna pustka | powiadomić () |
ostateczna pustka | powiadom wszystkich () |
Strunowy | doString () |
ostateczna pustka | czekaj (długi arg0, int arg1) |
ostateczna pustka | czekaj (długi arg0) |
ostateczna pustka | Czekać () |
Z interfejsu org.tensorflow.Operation streszczenie wew | inputListLength (nazwa ciągu) Zwraca rozmiar podanej listy wejściowej tensorów dla tej operacji. |
abstrakcyjny ciąg | nazwa () Zwraca pełną nazwę operacji. |
streszczenie wew | liczba wyjść () Zwraca liczbę tensorów wytworzonych w wyniku tej operacji. |
streszczenie <T> Dane wyjściowe <T> | wynik (int idx) Zwraca symboliczny uchwyt do jednego z tensorów utworzonych w wyniku tej operacji. |
streszczenie Dane wyjściowe[] <?> | lista wyjściowa (int idx, int długość) Zwraca uchwyty symboliczne do listy tensorów utworzonych w wyniku tej operacji. |
streszczenie wew | OutputListLength (nazwa ciągu) Zwraca rozmiar listy tensorów utworzonej w wyniku tej operacji. |
abstrakcyjny ciąg | typ () Zwraca typ operacji, tj. nazwę obliczenia wykonywanego przez operację. |
Metody publiczne
publiczna wartość logiczna równa się (Obiekt o)
publiczny int hashCode ()
Zwraca rozmiar podanej listy wejściowej tensorów dla tej operacji.
Operacja ma wiele nazwanych danych wejściowych, z których każdy zawiera pojedynczy tensor lub listę tensorów. Ta metoda zwraca rozmiar listy tensorów dla określonych nazwanych danych wejściowych operacji.
Parametry
nazwa | identyfikator listy tensorów (których może być wiele) danych wejściowych tej operacji. |
---|
Zwroty
- rozmiar listy tensorów utworzonych przez to nazwane wejście.
publiczna nazwa ciągu ()
Zwraca pełną nazwę operacji.
public int numOutputs ()
Zwraca liczbę tensorów wytworzonych w wyniku tej operacji.
publiczne wyjście <T> wyjście (int idx)
Zwraca symboliczny uchwyt do jednego z tensorów utworzonych w wyniku tej operacji.
Ostrzeżenie: nie sprawdza, czy typ tensora pasuje do T. Zaleca się wywoływanie tej metody z jawnym parametrem typu, zamiast pozwalać na wywnioskowanie tego, np operation.<Integer>output(0)
Parametry
idx | Indeks wyników wśród wyników uzyskanych w wyniku tej operacji. |
---|
public Output[] <?> OutputList (int idx, int długość)
Zwraca uchwyty symboliczne do listy tensorów utworzonych w wyniku tej operacji.
Parametry
idx | indeks pierwszego tensora listy |
---|
długość | liczba tensorów na liście |
---|
public int OutputListLength (nazwa ciągu)
Zwraca rozmiar listy tensorów utworzonej w wyniku tej operacji.
Operacja ma wiele nazwanych wyników, z których każdy generuje pojedynczy tensor lub listę tensorów. Ta metoda zwraca rozmiar listy tensorów dla określonego nazwanego wyniku operacji.
Parametry
nazwa | identyfikator listy tensorów (których może być wiele) utworzonej w wyniku tej operacji. |
---|
Zwroty
- rozmiar listy tensorów utworzonych przez to nazwane wyjście.
publiczny ciąg do ciągu ()
publiczny typ ciągu ()
Zwraca typ operacji, tj. nazwę obliczenia wykonywanego przez operację.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych. Część treści jest objęta licencją numpy.
Ostatnia aktualizacja: 2025-07-27 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],null,["# GraphOperation\n\npublic final class **GraphOperation** \nImplementation for an [Operation](/versions/r2.13/api_docs/java/org/tensorflow/Operation) added as a node to a [Graph](/versions/r2.13/api_docs/java/org/tensorflow/Graph).\n\nGraphOperation instances are valid only as long as the [Graph](/versions/r2.13/api_docs/java/org/tensorflow/Graph) they are a part of is\nvalid. Thus, if [Graph.close()](/versions/r2.13/api_docs/java/org/tensorflow/Graph#close()) has been invoked, then methods on the GraphOperation\ninstance may fail with an `IllegalStateException`.\n\nGraphOperation instances are immutable and thread-safe.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|--------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#equals(java.lang.Object))(Object o) |\n| int | [hashCode](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#hashCode())() |\n| int | [inputListLength](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#inputListLength(java.lang.String))(String name) Returns the size of the given inputs list of Tensors for this operation. |\n| String | [name](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#name())() Returns the full name of the Operation. |\n| int | [numOutputs](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#numOutputs())() Returns the number of tensors produced by this operation. |\n| \\\u003cT\\\u003e [Output](/versions/r2.13/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [output](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#output(int))(int idx) Returns a symbolic handle to one of the tensors produced by this operation. |\n| [Output\\[\\]](/versions/r2.13/api_docs/java/org/tensorflow/Output)\\\u003c?\\\u003e | [outputList](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#outputList(int,%20int))(int idx, int length) Returns symbolic handles to a list of tensors produced by this operation. |\n| int | [outputListLength](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#outputListLength(java.lang.String))(String name) Returns the size of the list of Tensors produced by this operation. |\n| String | [toString](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#toString())() |\n| String | [type](/versions/r2.13/api_docs/java/org/tensorflow/GraphOperation#type())() Returns the type of the operation, i.e., the name of the computation performed by the operation. |\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.Operation](/versions/r2.13/api_docs/java/org/tensorflow/Operation) \n\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [inputListLength](/versions/r2.13/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.13/api_docs/java/org/tensorflow/Operation#name())() Returns the full name of the Operation. |\n| abstract int | [numOutputs](/versions/r2.13/api_docs/java/org/tensorflow/Operation#numOutputs())() Returns the number of tensors produced by this operation. |\n| abstract \\\u003cT\\\u003e [Output](/versions/r2.13/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [output](/versions/r2.13/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.13/api_docs/java/org/tensorflow/Output)\\\u003c?\\\u003e | [outputList](/versions/r2.13/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.13/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.13/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 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**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#### public String\n**name**\n()\n\nReturns the full name of the Operation. \n\n#### public int\n**numOutputs**\n()\n\nReturns the number of tensors produced by this operation. \n\n#### public [Output](/versions/r2.13/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 [Output\\[\\]](/versions/r2.13/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 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#### public String\n**toString**\n()\n\n\u003cbr /\u003e\n\n#### public String\n**type**\n()\n\nReturns the type of the operation, i.e., the name of the computation performed by the\noperation."]]