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