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> เทนเซอร์ ()
ส่งกลับเทนเซอร์ที่เอาต์พุตนี้
การดำเนินการนี้รองรับเฉพาะกับผลลัพธ์ของการดำเนินการที่ดำเนินการอย่างกระตือรือร้นเท่านั้น สำหรับสภาพแวดล้อมแบบกราฟ ต้องดึงเอาท์พุตเทนเซอร์โดยการรันเซสชันโดยใช้ fetch(Output)
ขว้าง
IllegalStateException | หากผลลัพธ์นี้เป็นผลจากกราฟ |
---|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers ส่วน Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ เนื้อหาบางส่วนได้รับอนุญาตภายใต้ใบอนุญาต NumPy
อัปเดตล่าสุด 2025-07-28 UTC
[null,null,["อัปเดตล่าสุด 2025-07-28 UTC"],[],[],null,["# Output\n\npublic final class **Output** \n\nA symbolic handle to a tensor produced by an\n`\n`[Operation](/versions/r2.6/api_docs/java/org/tensorflow/Operation)`\n`\n.\n\n\nAn\n`\nOutput\u003cT\u003e\n`\nis a symbolic handle to a\n`\nTensor\u003cT\u003e\n`\n. The value of the tensor is\ncomputed by executing the\n`\n`[Operation](/versions/r2.6/api_docs/java/org/tensorflow/Operation)`\n`\nin a\n`\n`[Session](/versions/r2.6/api_docs/java/org/tensorflow/Session)`\n`\n.\n\n\nBy implementing the\n`\n`[Operand](/versions/r2.6/api_docs/java/org/tensorflow/Operand)`\n`\ninterface, instances of this class also act as operands to\n`\n`[Op](/versions/r2.6/api_docs/java/org/tensorflow/op/Op)`\n`\ninstances.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Output](/versions/r2.6/api_docs/java/org/tensorflow/Output) \\\u003cT\\\u003e | [asOutput](/versions/r2.6/api_docs/java/org/tensorflow/Output#asOutput()) () Returns the symbolic handle of a tensor. |\n| [DataType](/versions/r2.6/api_docs/java/org/tensorflow/DataType) | [dataType](/versions/r2.6/api_docs/java/org/tensorflow/Output#dataType()) () Returns the DataType of the tensor referred to by this Output. |\n| boolean | [equals](/versions/r2.6/api_docs/java/org/tensorflow/Output#equals(java.lang.Object)) (Object o) |\n| int | [hashCode](/versions/r2.6/api_docs/java/org/tensorflow/Output#hashCode()) () |\n| int | [index](/versions/r2.6/api_docs/java/org/tensorflow/Output#index()) () Returns the index into the outputs of the Operation. |\n| [Operation](/versions/r2.6/api_docs/java/org/tensorflow/Operation) | [op](/versions/r2.6/api_docs/java/org/tensorflow/Output#op()) () Returns the Operation that will produce the tensor referred to by this Output. |\n| [Shape](/versions/r2.6/api_docs/java/org/tensorflow/Shape) | [shape](/versions/r2.6/api_docs/java/org/tensorflow/Output#shape()) () Returns the (possibly partially known) shape of the tensor referred to by this Output. |\n| [Tensor](/versions/r2.6/api_docs/java/org/tensorflow/Tensor) \\\u003cT\\\u003e | [tensor](/versions/r2.6/api_docs/java/org/tensorflow/Output#tensor()) () Returns the tensor at this output. |\n| String | [toString](/versions/r2.6/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](/versions/r2.6/api_docs/java/org/tensorflow/Operand) \n\n|-----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|\n| abstract [Output](/versions/r2.6/api_docs/java/org/tensorflow/Output) \\\u003cT\\\u003e | [asOutput](/versions/r2.6/api_docs/java/org/tensorflow/Operand#asOutput()) () Returns the symbolic handle of a tensor. |\n\nPublic Methods\n--------------\n\n\n#### public [Output](/versions/r2.6/api_docs/java/org/tensorflow/Output) \\\u003cT\\\u003e\n**asOutput**\n()\n\n\nReturns the symbolic handle of a tensor.\n\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\n#### public [DataType](/versions/r2.6/api_docs/java/org/tensorflow/DataType)\n**dataType**\n()\n\n\nReturns the DataType of the tensor referred to by this Output.\n\n#### public boolean\n**equals**\n(Object o)\n\n\n#### public int\n**hashCode**\n()\n\n\n#### public int\n**index**\n()\n\n\nReturns the index into the outputs of the Operation.\n\n#### public [Operation](/versions/r2.6/api_docs/java/org/tensorflow/Operation)\n**op**\n()\n\n\nReturns the Operation that will produce the tensor referred to by this Output.\n\n#### public [Shape](/versions/r2.6/api_docs/java/org/tensorflow/Shape)\n**shape**\n()\n\n\nReturns the (possibly partially known) shape of the tensor referred to by this Output.\n\n#### public [Tensor](/versions/r2.6/api_docs/java/org/tensorflow/Tensor) \\\u003cT\\\u003e\n**tensor**\n()\n\n\nReturns the tensor at this output.\n\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\n`\n`[fetch(Output)](/versions/r2.6/api_docs/java/org/tensorflow/Session.Runner#fetch(org.tensorflow.Output\u003c?\u003e))`\n`\n.\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- `\n `[EagerSession](/versions/r2.6/api_docs/java/org/tensorflow/EagerSession)`\n `\n\n#### public String\n**toString**\n()"]]