Ostrzeżenie: ten interfejs API jest przestarzały i zostanie usunięty w przyszłej wersji TensorFlow, gdy zamiennik będzie stabilny.
EagerSession.Options
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
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ć () |
Metody publiczne
publiczna asynchronizacja EagerSession.Options (wartość logiczna)
Kontroluje sposób, w jaki wysyłane operacje są faktycznie wykonywane.
Jeśli ustawione na true, każda operacja jest wykonywana asynchronicznie (w takim przypadku niektóre operacje mogą zwracać „niegotowe” dane wyjściowe). Po ustawieniu wartości false wszystkie operacje są wykonywane synchronicznie.
Domyślnie używane jest wykonywanie synchroniczne.
Parametry
wartość | true dla wykonywania asynchronicznego, false dla synchronicznego. |
---|
Tworzy chętną sesję z wybranymi opcjami.
publiczna konfiguracja EagerSession.Options (wartość bajtu [])
Konfiguruje sesję na podstawie danych znalezionych w dostarczonym buforze, który jest serializowanym protokonfiguracją TensorFlow.
Ostrzeżenie: obsługa tej funkcji może ulec zmianom, ponieważ protosy TensorFlow mogą w przyszłości nie być obsługiwane na publicznych punktach końcowych.
Zobacz też: config.proto
Parametry
wartość | serializowany proto konfiguracji |
---|
Kontroluje sposób działania, gdy próbujemy wykonać operację na danym urządzeniu, ale na tym urządzeniu nie ma niektórych tensorów wejściowych.
Domyślnie używana jest EagerSession.DevicePlacementPolicy.SILENT
.
Parametry
wartość | zasady, które należy zastosować |
---|
Parametry
wartość | strategię, którą należy zastosować |
---|
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.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[],[],null,["# EagerSession.Options\n\npublic static class **EagerSession.Options** \n\n### Public Methods\n\n|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options) | [async](/api_docs/java/org/tensorflow/EagerSession.Options#async(boolean))(boolean value) Controls how operations dispatched are actually executed. |\n| [EagerSession](/api_docs/java/org/tensorflow/EagerSession) | [build](/api_docs/java/org/tensorflow/EagerSession.Options#build())() Builds an eager session with the selected options. |\n| [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options) | [config](/api_docs/java/org/tensorflow/EagerSession.Options#config(byte[]))(byte\\[\\] value) Configures the session based on the data found in the provided buffer, which is serialized TensorFlow config proto. |\n| [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options) | [devicePlacementPolicy](/api_docs/java/org/tensorflow/EagerSession.Options#devicePlacementPolicy(org.tensorflow.EagerSession.DevicePlacementPolicy))([EagerSession.DevicePlacementPolicy](/api_docs/java/org/tensorflow/EagerSession.DevicePlacementPolicy) value) Controls how to act when we try to run an operation on a given device but some input tensors are not on that device. |\n| [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options) | [resourceCleanupStrategy](/api_docs/java/org/tensorflow/EagerSession.Options#resourceCleanupStrategy(org.tensorflow.EagerSession.ResourceCleanupStrategy))([EagerSession.ResourceCleanupStrategy](/api_docs/java/org/tensorflow/EagerSession.ResourceCleanupStrategy) value) Controls how TensorFlow resources are cleaned up when no longer needed. |\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\nPublic Methods\n--------------\n\n#### public [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options)\n**async**\n(boolean value)\n\nControls how operations dispatched are actually executed.\n\nWhen set to true, each operation are executed asynchronously (in which case some\noperations might return \"non-ready\" outputs). When set to false, all operations are executed\nsynchronously.\n\nSynchronous execution is used by default.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| value | true for asynchronous execution, false for synchronous. |\n|-------|---------------------------------------------------------|\n\n#### public [EagerSession](/api_docs/java/org/tensorflow/EagerSession)\n**build**\n()\n\nBuilds an eager session with the selected options. \n\n#### public [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options)\n**config**\n(byte\\[\\] value)\n\nConfigures the session based on the data found in the provided buffer, which is serialized\nTensorFlow config proto.\n\nWarning: the support of this feature is subject to changes since TensorFlow protos might\nnot be supported on public endpoints in the future.\n\nSee also: [config.proto](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| value | a serialized config proto |\n|-------|---------------------------|\n\n#### public [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options)\n**devicePlacementPolicy**\n([EagerSession.DevicePlacementPolicy](/api_docs/java/org/tensorflow/EagerSession.DevicePlacementPolicy) value)\n\nControls how to act when we try to run an operation on a given device but some input tensors\nare not on that device.\n\n[EagerSession.DevicePlacementPolicy.SILENT](/api_docs/java/org/tensorflow/EagerSession.DevicePlacementPolicy#SILENT) is used by default.\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| value | policy to apply |\n|-------|-----------------|\n\n##### See Also\n\n- [EagerSession.DevicePlacementPolicy](/api_docs/java/org/tensorflow/EagerSession.DevicePlacementPolicy) \n\n#### public [EagerSession.Options](/api_docs/java/org/tensorflow/EagerSession.Options)\n**resourceCleanupStrategy**\n([EagerSession.ResourceCleanupStrategy](/api_docs/java/org/tensorflow/EagerSession.ResourceCleanupStrategy) value)\n\nControls how TensorFlow resources are cleaned up when no longer needed.\n\n[EagerSession.ResourceCleanupStrategy.IN_BACKGROUND](/api_docs/java/org/tensorflow/EagerSession.ResourceCleanupStrategy#IN_BACKGROUND) is used by default.\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| value | strategy to use |\n|-------|-----------------|\n\n##### See Also\n\n- [EagerSession.ResourceCleanupStrategy](/api_docs/java/org/tensorflow/EagerSession.ResourceCleanupStrategy)"]]