تدفق التوتر:: العمليات:: refSwitch
#include <control_flow_ops.h>
يقوم بإعادة توجيه data
موتر المرجع إلى منفذ الإخراج المحدد بواسطة pred
.
ملخص
إذا كان pred
صحيحًا، فسيتم إعادة توجيه إدخال data
إلى output_true
. وإلا فإن البيانات تذهب إلى output_false
.
الحجج:
- النطاق: كائن النطاق
- البيانات: سيتم إعادة توجيه موتر المرجع إلى الإخراج المناسب.
- pred: عددي يحدد منفذ الإخراج الذي سيستقبل البيانات.
العوائد:
-
Output
: إذا كانتpred
خاطئة، فسيتم إعادة توجيه البيانات إلى هذا الإخراج. -
Output
: إذا كانpred
صحيحًا، فسيتم إعادة توجيه البيانات إلى هذا الإخراج.
البنائين والمدمرين | |
---|---|
RefSwitch (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input pred) |
الصفات العامة | |
---|---|
operation | |
output_false | |
output_true |
الصفات العامة
عملية
Operation operation
input_false
::tensorflow::Output output_false
input_true
::tensorflow::Output output_true
الوظائف العامة
refSwitch
RefSwitch( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input pred )
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::RefSwitch Class Reference\n\ntensorflow::ops::RefSwitch\n==========================\n\n`#include \u003ccontrol_flow_ops.h\u003e`\n\nForwards the ref tensor `data` to the output port determined by `pred`.\n\nSummary\n-------\n\nIf `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, the data goes to `output_false`.\n\nSee also [Switch](/versions/r2.2/api_docs/cc/class/tensorflow/ops/switch#classtensorflow_1_1ops_1_1_switch) and [Merge](/versions/r2.2/api_docs/cc/class/tensorflow/ops/merge#classtensorflow_1_1ops_1_1_merge).\n\nArguments:\n\n- scope: A [Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- data: The ref tensor to be forwarded to the appropriate output.\n- pred: A scalar that specifies which output port will receive data.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_false: If `pred` is false, data will be forwarded to this output.\n- [Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_true: If `pred` is true, data will be forwarded to this output.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RefSwitch](#classtensorflow_1_1ops_1_1_ref_switch_1a6776369f0966446feb0aa0f9d413aba0)`(const ::`[tensorflow::Scope](/versions/r2.2/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` data, ::`[tensorflow::Input](/versions/r2.2/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pred)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_ref_switch_1a2ccd0f134fb8e9af48737d5ba0434056) | [Operation](/versions/r2.2/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_false](#classtensorflow_1_1ops_1_1_ref_switch_1a070534567ff9bb630bfee0c600d75ae4) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_true](#classtensorflow_1_1ops_1_1_ref_switch_1ae47dda15cdabd3d3badf4eaadb5f91b7) | `::`[tensorflow::Output](/versions/r2.2/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output_false\n\n```scdoc\n::tensorflow::Output output_false\n``` \n\n### output_true\n\n```scdoc\n::tensorflow::Output output_true\n``` \n\nPublic functions\n----------------\n\n### RefSwitch\n\n```gdscript\n RefSwitch(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input data,\n ::tensorflow::Input pred\n)\n```"]]