คำเตือน: API นี้เลิกใช้แล้วและจะถูกลบออกใน TensorFlow เวอร์ชันอนาคตหลังจากที่ การแทนที่ มีเสถียรภาพ
EagerSession.Options
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
วิธีการสืบทอด
จากคลาส java.lang.Object บูลีน | เท่ากับ (วัตถุ arg0) |
คลาสสุดท้าย<?> | รับคลาส () |
ภายใน | แฮชโค้ด () |
โมฆะสุดท้าย | แจ้ง () |
โมฆะสุดท้าย | แจ้งทั้งหมด () |
สตริง | toString () |
โมฆะสุดท้าย | รอสักครู่ (ยาว arg0, int arg1) |
โมฆะสุดท้าย | รอ (ยาว arg0) |
โมฆะสุดท้าย | รอ () |
วิธีการสาธารณะ
ควบคุมวิธีการดำเนินการที่จัดส่งไปจริง
เมื่อตั้งค่าเป็นจริง แต่ละการดำเนินการจะดำเนินการแบบอะซิงโครนัส (ซึ่งในกรณีนี้การดำเนินการบางอย่างอาจส่งคืนเอาต์พุต "ไม่พร้อม") เมื่อตั้งค่าเป็นเท็จ การดำเนินการทั้งหมดจะดำเนินการพร้อมกัน
การดำเนินการแบบซิงโครนัสถูกใช้เป็นค่าเริ่มต้น
พารามิเตอร์
ค่า | จริงสำหรับการดำเนินการแบบอะซิงโครนัส เท็จสำหรับซิงโครนัส |
---|
สร้างเซสชันที่กระตือรือร้นด้วยตัวเลือกที่เลือก
กำหนดค่าเซสชันตามข้อมูลที่พบในบัฟเฟอร์ที่ให้มา ซึ่งเป็นโปรโตคอลการกำหนดค่า TensorFlow แบบอนุกรม
คำเตือน: การรองรับฟีเจอร์นี้อาจมีการเปลี่ยนแปลง เนื่องจากโปรโตส TensorFlow อาจไม่รองรับบนปลายทางสาธารณะในอนาคต
ดูเพิ่มเติมที่: config.proto
พารามิเตอร์
ค่า | โปรโตคอลการกำหนดค่าแบบอนุกรม |
---|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 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)"]]