コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦:: RefSwitch
#include <control_flow_ops.h>
ref テンソルdata
pred
によって決定される出力端子に転送します。
まとめ
pred
が true の場合、 data
入力はoutput_true
に転送されます。それ以外の場合、データはoutput_false
に送られます。
Switch
とMerge
も参照してください。
引数:
- スコープ:スコープオブジェクト
- data: 適切な出力に転送される参照テンソル。
- pred: どの出力ポートがデータを受信するかを指定するスカラー。
戻り値:
-
Output
Output_false: pred
が false の場合、データはこの出力に転送されます。 -
Output
Output_true: pred
が true の場合、データはこの出力に転送されます。
パブリック属性
公共機能
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[null,null,["最終更新日 2025-07-26 UTC。"],[],[],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```"]]