คำเตือน: API นี้เลิกใช้แล้วและจะถูกลบออกใน TensorFlow เวอร์ชันอนาคตหลังจากที่ การแทนที่ มีเสถียรภาพ
GraphOperation
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การใช้งานสำหรับ Operation
ที่เพิ่มเป็นโหนดใน Graph
อินสแตนซ์ GraphOperation จะใช้ได้ก็ต่อเมื่อ Graph
ที่เป็นส่วนหนึ่งนั้นถูกต้องเท่านั้น ดังนั้น หากมีการเรียกใช้ Graph.close()
วิธีการบนอินสแตนซ์ GraphOperation อาจล้มเหลวด้วย IllegalStateException
อินสแตนซ์ GraphOperation จะไม่เปลี่ยนรูปและปลอดภัยต่อเธรด
วิธีการสาธารณะ
บูลีน | |
ภายใน | |
ภายใน | inputListLength (ชื่อสตริง) ส่งกลับขนาดของรายการอินพุตที่กำหนดของเทนเซอร์สำหรับการดำเนินการนี้ |
สตริง | ชื่อ () ส่งกลับชื่อเต็มของการดำเนินการ |
ภายใน | |
<T> เอาท์พุต <T> | เอาท์พุต (int idx) ส่งคืนแฮนเดิลเชิงสัญลักษณ์ให้กับหนึ่งในเทนเซอร์ที่เกิดจากการดำเนินการนี้ |
เอาท์พุต[] <?> | รายการเอาต์พุต (int idx, int length) ส่งกลับตัวจัดการเชิงสัญลักษณ์ไปยังรายการเทนเซอร์ที่เกิดจากการดำเนินการนี้ |
ภายใน | outputListLength (ชื่อสตริง) ส่งกลับขนาดของรายการ Tensors ที่เกิดจากการดำเนินการนี้ |
สตริง | |
สตริง | พิมพ์ () ส่งกลับประเภทของการดำเนินการ เช่น ชื่อของการคำนวณที่ดำเนินการโดยการดำเนินการ |
วิธีการสืบทอด
จากคลาส java.lang.Object บูลีน | เท่ากับ (วัตถุ arg0) |
คลาสสุดท้าย<?> | รับคลาส () |
ภายใน | แฮชโค้ด () |
โมฆะสุดท้าย | แจ้ง () |
โมฆะสุดท้าย | แจ้งทั้งหมด () |
สตริง | toString () |
โมฆะสุดท้าย | รอสักครู่ (ยาว arg0, int arg1) |
โมฆะสุดท้าย | รอ (ยาว arg0) |
โมฆะสุดท้าย | รอ () |
จากอินเทอร์ เฟซ org.tensorflow.Operation บทคัดย่อ | inputListLength (ชื่อสตริง) ส่งกลับขนาดของรายการอินพุตที่กำหนดของเทนเซอร์สำหรับการดำเนินการนี้ |
สตริงที่เป็นนามธรรม | ชื่อ () ส่งกลับชื่อเต็มของการดำเนินการ |
บทคัดย่อ | |
นามธรรม <T> เอาท์พุต <T> | เอาท์พุต (int idx) ส่งคืนแฮนเดิลเชิงสัญลักษณ์ให้กับหนึ่งในเทนเซอร์ที่เกิดจากการดำเนินการนี้ |
เอาท์ พุทนามธรรม [] <?> | รายการเอาต์พุต (int idx, int length) ส่งกลับตัวจัดการเชิงสัญลักษณ์ไปยังรายการเทนเซอร์ที่เกิดจากการดำเนินการนี้ |
บทคัดย่อ | outputListLength (ชื่อสตริง) ส่งกลับขนาดของรายการ Tensors ที่เกิดจากการดำเนินการนี้ |
สตริงที่เป็นนามธรรม | พิมพ์ () ส่งกลับประเภทของการดำเนินการ เช่น ชื่อของการคำนวณที่ดำเนินการโดยการดำเนินการ |
วิธีการสาธารณะ
บูลีนสาธารณะ เท่ากับ (Object o)
ส่งกลับขนาดของรายการอินพุตที่กำหนดของเทนเซอร์สำหรับการดำเนินการนี้
การดำเนินการมีอินพุตหลายชื่อ ซึ่งแต่ละอินพุตจะมีเทนเซอร์ตัวเดียวหรือรายการเทนเซอร์ วิธีการนี้จะส่งคืนขนาดของรายการเทนเซอร์สำหรับอินพุตที่มีชื่อเฉพาะของการดำเนินการ
พารามิเตอร์
ชื่อ | ตัวระบุรายการเทนเซอร์ (ซึ่งอาจมีหลายรายการ) อินพุตสำหรับการดำเนินการนี้ |
---|
การส่งคืน
- ขนาดของรายการเทนเซอร์ที่สร้างโดยอินพุตที่มีชื่อนี้
ชื่อ สตริงสาธารณะ ()
ส่งกลับชื่อเต็มของการดำเนินการ
สาธารณะ int numOutputs ()
ส่งกลับจำนวนเทนเซอร์ที่เกิดจากการดำเนินการนี้
เอาท์ พุท สาธารณะ <T> เอาท์พุท (int idx)
ส่งคืนแฮนเดิลเชิงสัญลักษณ์ให้กับหนึ่งในเทนเซอร์ที่เกิดจากการดำเนินการนี้
คำเตือน: ไม่ได้ตรวจสอบว่าประเภทของเทนเซอร์ตรงกับ T ขอแนะนำให้เรียกเมธอดนี้ด้วยพารามิเตอร์ประเภทที่ชัดเจน แทนที่จะปล่อยให้มันถูกอนุมาน เช่น operation.<Integer>output(0)
พารามิเตอร์
รหัสประจำตัว | ดัชนีของเอาต์พุตระหว่างเอาต์พุตที่เกิดจากการดำเนินการนี้ |
---|
เอาท์พุทสาธารณะ [] <?> รายการเอาท์พุท (int idx, ความยาว int)
ส่งกลับตัวจัดการเชิงสัญลักษณ์ไปยังรายการเทนเซอร์ที่เกิดจากการดำเนินการนี้
พารามิเตอร์
รหัสประจำตัว | ดัชนีเทนเซอร์แรกของรายการ |
---|
ความยาว | จำนวนเทนเซอร์ในรายการ |
---|
int สาธารณะ outputListLength (ชื่อสตริง)
ส่งกลับขนาดของรายการ Tensors ที่เกิดจากการดำเนินการนี้
การดำเนินการมีเอาต์พุตที่มีชื่อหลายรายการ ซึ่งแต่ละเอาต์พุตจะสร้างเทนเซอร์ตัวเดียวหรือรายการเทนเซอร์ วิธีนี้จะส่งคืนขนาดของรายการเทนเซอร์สำหรับเอาต์พุตที่มีชื่อเฉพาะของการดำเนินการ
พารามิเตอร์
ชื่อ | ตัวระบุรายการเทนเซอร์ (ซึ่งอาจมีหลายรายการ) ที่สร้างโดยการดำเนินการนี้ |
---|
การส่งคืน
- ขนาดของรายการเทนเซอร์ที่สร้างโดยเอาต์พุตที่มีชื่อนี้
ประเภท สตริงสาธารณะ ()
ส่งกลับประเภทของการดำเนินการ เช่น ชื่อของการคำนวณที่ดำเนินการโดยการดำเนินการ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[],null,["# GraphOperation\n\npublic final class **GraphOperation** \nImplementation for an [Operation](/api_docs/java/org/tensorflow/Operation) added as a node to a [Graph](/api_docs/java/org/tensorflow/Graph).\n\nGraphOperation instances are valid only as long as the [Graph](/api_docs/java/org/tensorflow/Graph) they are a part of is\nvalid. Thus, if [Graph.close()](/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](/api_docs/java/org/tensorflow/GraphOperation#equals(java.lang.Object))(Object o) |\n| int | [hashCode](/api_docs/java/org/tensorflow/GraphOperation#hashCode())() |\n| int | [inputListLength](/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](/api_docs/java/org/tensorflow/GraphOperation#name())() Returns the full name of the Operation. |\n| int | [numOutputs](/api_docs/java/org/tensorflow/GraphOperation#numOutputs())() Returns the number of tensors produced by this operation. |\n| \\\u003cT\\\u003e [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [output](/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\\[\\]](/api_docs/java/org/tensorflow/Output)\\\u003c?\\\u003e | [outputList](/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](/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](/api_docs/java/org/tensorflow/GraphOperation#toString())() |\n| String | [type](/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](/api_docs/java/org/tensorflow/Operation) \n\n|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [inputListLength](/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](/api_docs/java/org/tensorflow/Operation#name())() Returns the full name of the Operation. |\n| abstract int | [numOutputs](/api_docs/java/org/tensorflow/Operation#numOutputs())() Returns the number of tensors produced by this operation. |\n| abstract \\\u003cT\\\u003e [Output](/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [output](/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\\[\\]](/api_docs/java/org/tensorflow/Output)\\\u003c?\\\u003e | [outputList](/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](/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](/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](/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\\[\\]](/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."]]