هشدار: این API منسوخ شده است و پس از پایدار شدن جایگزینی، در نسخه بعدی TensorFlow حذف خواهد شد.
Operation
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
زیر کلاس های غیر مستقیم شناخته شده |
محاسبات را روی تانسورها انجام می دهد.
یک عملیات صفر یا بیشتر Tensor
s (تولید شده توسط سایر عملیات ها) را به عنوان ورودی می گیرد و صفر یا بیشتر Tensor
را به عنوان خروجی تولید می کند.
روش های عمومی
انتزاعی | inputListLength (نام رشته) اندازه لیست ورودی داده شده تانسورها را برای این عملیات برمی گرداند. |
رشته انتزاعی | نام () نام کامل عملیات را برمیگرداند. |
انتزاعی | numOutputs () تعداد تانسورهای تولید شده توسط این عملیات را برمیگرداند. |
چکیده <T> خروجی <T> | خروجی (int idx) یک دسته نمادین را به یکی از تانسورهای تولید شده توسط این عملیات برمی گرداند. |
خروجی چکیده [] <?> | outputList (int idx، int length) دستگیره های نمادین را به لیستی از تانسورهای تولید شده توسط این عملیات برمی گرداند. |
انتزاعی | outputListLength (نام رشته) اندازه لیست تنسورهای تولید شده توسط این عملیات را برمی گرداند. |
رشته انتزاعی | نوع () نوع عملیات، یعنی نام محاسبات انجام شده توسط عملیات را برمی گرداند. |
روش های عمومی
اندازه لیست ورودی داده شده تانسورها را برای این عملیات برمی گرداند.
یک عملیات دارای چندین ورودی با نام است که هر کدام شامل یک تانسور یا لیستی از تانسورها می باشد. این روش اندازه لیست تانسورها را برای یک ورودی با نام خاص عملیات برمی گرداند.
مولفه های
نام | شناسه لیست تانسورها (که ممکن است تعداد زیادی از آنها وجود داشته باشد) ورودی های این عملیات. |
---|
برمی گرداند
- اندازه لیست تنسورهای تولید شده توسط این ورودی نامگذاری شده است.
پرتاب می کند
IllegalArgumentException | اگر این عملیات ورودی با نام ارائه شده نداشته باشد. |
---|
نام رشته انتزاعی عمومی ()
نام کامل عملیات را برمیگرداند.
انتزاع عمومی int numOutputs ()
تعداد تانسورهای تولید شده توسط این عملیات را برمیگرداند.
خروجی انتزاعی عمومی <T> خروجی (int idx)
یک دسته نمادین را به یکی از تانسورهای تولید شده توسط این عملیات برمی گرداند.
اخطار: بررسی نمیکند که نوع تانسور با T مطابقت داشته باشد. توصیه میشود این روش را با یک پارامتر نوع صریح فراخوانی کنید نه اینکه اجازه دهید آن را استنتاج کنید، مثلاً operation.<Integer>output(0)
مولفه های
idx | شاخص خروجی در میان خروجی های تولید شده توسط این عملیات. |
---|
دستگیره های نمادین را به لیستی از تانسورهای تولید شده توسط این عملیات برمی گرداند.
مولفه های
idx | شاخص تانسور اول لیست |
---|
طول | تعداد تانسورها در لیست |
---|
انتزاع عمومی int outputListLength (نام رشته)
اندازه لیست تنسورهای تولید شده توسط این عملیات را برمی گرداند.
یک عملیات دارای چندین خروجی با نام است که هر کدام یک تانسور یا فهرستی از تانسورها را تولید می کند. این روش اندازه لیست تانسورها را برای خروجی نامگذاری شده خاصی از عملیات برمی گرداند.
مولفه های
نام | شناسه لیست تانسورها (که ممکن است تعداد زیادی از آنها وجود داشته باشد) توسط این عملیات تولید شده است. |
---|
برمی گرداند
- اندازه لیست تنسورهای تولید شده توسط این خروجی نامگذاری شده است.
پرتاب می کند
IllegalArgumentException | اگر این عملیات خروجی با نام ارائه شده نداشته باشد. |
---|
نوع رشته انتزاعی عمومی ()
نوع عملیات، یعنی نام محاسبات انجام شده توسط عملیات را برمی گرداند.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Operation\n\npublic interface **Operation** \n\n|---|---|---|\n| Known Indirect Subclasses [GraphOperation](/api_docs/java/org/tensorflow/GraphOperation) |----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------| | [GraphOperation](/api_docs/java/org/tensorflow/GraphOperation) | Implementation for an [Operation](/api_docs/java/org/tensorflow/Operation) added as a node to a [Graph](/api_docs/java/org/tensorflow/Graph). | |||\n\nPerforms computation on Tensors.\n\nAn Operation takes zero or more [Tensor](/api_docs/java/org/tensorflow/Tensor)s (produced by other Operations) as input, and\nproduces zero or more [Tensor](/api_docs/java/org/tensorflow/Tensor)s as output.\n\n\u003cbr /\u003e\n\n### Public Methods\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 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](/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\\[\\]](/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."]]