Operation
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מבצע חישוב על טנסורים.
פעולה לוקחת אפס או יותר Tensor
s (המופק על ידי פעולות אחרות) כקלט, ומפיקה אפס או יותר Tensor
כפלט.
שיטות ציבוריות
מופשט int | inputListLength (שם מחרוזת) מחזירה את הגודל של רשימת הקלט הנתונה של Tensors עבור פעולה זו. |
מחרוזת מופשטת | שם () מחזירה את השם המלא של המבצע. |
מופשט int | numOutputs () מחזירה את מספר הטנזורים שנוצרו על ידי פעולה זו. |
תקציר <T> פלט <T> | פלט (int idx) מחזיר ידית סמלית לאחד הטנזורים המיוצרים בפעולה זו. |
פלט מופשט[] <?> | outputList (int idx, int length) מחזירה נקודות אחיזה סמליות לרשימת הטנזורים שנוצרה על ידי פעולה זו. |
מופשט int | outputListLength (שם מחרוזת) מחזירה את גודל רשימת הטנזורים שנוצרה על ידי פעולה זו. |
מחרוזת מופשטת | סוג () מחזירה את סוג הפעולה, כלומר, שם החישוב שבוצע על ידי הפעולה. |
שיטות ציבוריות
מחזירה את הגודל של רשימת הקלט הנתונה של Tensors עבור פעולה זו.
לפעולה יש מספר כניסות בשם, שכל אחת מהן מכילה טנסור בודד או רשימה של טנזורים. שיטה זו מחזירה את גודל רשימת הטנזורים עבור קלט ספציפי בשם של הפעולה.
פרמטרים
שֵׁם | מזהה של רשימת הטנזורים (שעשויים להיות רבים מהם) כניסות לפעולה זו. |
---|
החזרות
- גודל רשימת הטנזורים המיוצרים על ידי הקלט הנקוב הזה.
זורק
חריג טיעון לא חוקי | אם לפעולה זו אין קלט עם השם שסופק. |
---|
תקציר ציבורי שם מחרוזת ()
מחזירה את השם המלא של המבצע.
תקציר ציבורי int numOutputs ()
מחזירה את מספר הטנזורים שנוצרו על ידי פעולה זו.
תקציר ציבורי פלט <T> פלט (int idx)
מחזיר ידית סמלית לאחד הטנזורים המיוצרים בפעולה זו.
אזהרה: לא בודק שסוג הטנזור תואם ל-T. מומלץ לקרוא לשיטה זו עם פרמטר סוג מפורש במקום לתת להסיק, למשל operation.<Integer>output(0)
פרמטרים
idx | מדד התפוקה בין התפוקות המופקות בפעולה זו. |
---|
תקציר ציבורי פלט[] <?> outputList (int idx, int length)
מחזירה נקודות אחיזה סמליות לרשימת הטנזורים שנוצרה על ידי פעולה זו.
פרמטרים
idx | אינדקס של הטנסור הראשון של הרשימה |
---|
אורך | מספר הטנזורים ברשימה |
---|
תקציר ציבורי int outputListLength (שם מחרוזת)
מחזירה את גודל רשימת הטנזורים שנוצרה על ידי פעולה זו.
למבצע יש מספר פלטים בעלי שם, שכל אחד מהם מייצר טנסור בודד או רשימה של טנסורים. שיטה זו מחזירה את גודל רשימת הטנזורים עבור פלט ספציפי בשם של הפעולה.
פרמטרים
שֵׁם | מזהה של רשימת הטנזורים (שעשויים להיות רבים מהם) המיוצרים על ידי פעולה זו. |
---|
החזרות
- גודל רשימת הטנזורים המיוצרים על ידי פלט זה.
זורק
חריג טיעון לא חוקי | אם לפעולה זו אין פלט עם השם שצוין. |
---|
תקציר ציבורי סוג מחרוזת ()
מחזירה את סוג הפעולה, כלומר, שם החישוב שבוצע על ידי הפעולה.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים נוספים, אפשר לקרוא את מדיניות האתר של Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה. חלק מהתוכן הוא ברישיון NumPy.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# Operation\n\npublic interface **Operation** \n\n|---|---|---|\n| Known Indirect Subclasses [GraphOperation](/versions/r2.14/api_docs/java/org/tensorflow/GraphOperation) |-------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [GraphOperation](/versions/r2.14/api_docs/java/org/tensorflow/GraphOperation) | Implementation for an [Operation](/versions/r2.14/api_docs/java/org/tensorflow/Operation) added as a node to a [Graph](/versions/r2.14/api_docs/java/org/tensorflow/Graph). | |||\n\nPerforms computation on Tensors.\n\nAn Operation takes zero or more [Tensor](/versions/r2.14/api_docs/java/org/tensorflow/Tensor)s (produced by other Operations) as input, and\nproduces zero or more [Tensor](/versions/r2.14/api_docs/java/org/tensorflow/Tensor)s as output.\n\n\u003cbr /\u003e\n\n### Public Methods\n\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [inputListLength](/versions/r2.14/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](/versions/r2.14/api_docs/java/org/tensorflow/Operation#name())() Returns the full name of the Operation. |\n| abstract int | [numOutputs](/versions/r2.14/api_docs/java/org/tensorflow/Operation#numOutputs())() Returns the number of tensors produced by this operation. |\n| abstract \\\u003cT\\\u003e [Output](/versions/r2.14/api_docs/java/org/tensorflow/Output)\\\u003cT\\\u003e | [output](/versions/r2.14/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\\[\\]](/versions/r2.14/api_docs/java/org/tensorflow/Output)\\\u003c?\\\u003e | [outputList](/versions/r2.14/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](/versions/r2.14/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](/versions/r2.14/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 abstract 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##### Throws\n\n| IllegalArgumentException | if this operation has no input with the provided name. |\n|--------------------------|--------------------------------------------------------|\n\n#### public abstract String\n**name**\n()\n\nReturns the full name of the Operation. \n\n#### public abstract int\n**numOutputs**\n()\n\nReturns the number of tensors produced by this operation. \n\n#### public abstract [Output](/versions/r2.14/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 abstract [Output\\[\\]](/versions/r2.14/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 abstract 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##### Throws\n\n| IllegalArgumentException | if this operation has no output with the provided name. |\n|--------------------------|---------------------------------------------------------|\n\n#### public abstract String\n**type**\n()\n\nReturns the type of the operation, i.e., the name of the computation performed by the\noperation."]]