컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 스위치
#include <control_flow_ops.h>
pred
에 의해 결정된 출력 포트로 data
전달합니다.
요약
pred
가 true이면 data
입력이 output_true
로 전달됩니다. 그렇지 않으면 데이터는 output_false
로 이동합니다.
RefSwitch
및 Merge
도 참조하세요.
인수:
- 범위: 범위 개체
- data: 적절한 출력으로 전달될 텐서입니다.
- pred: 데이터를 수신할 출력 포트를 지정하는 스칼라입니다.
보고:
-
Output
output_false: pred
가 false인 경우 데이터가 이 출력으로 전달됩니다. -
Output
Output_true: pred
가 true이면 데이터가 이 출력으로 전달됩니다.
공개 속성
공공 기능
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# tensorflow::ops::Switch Class Reference\n\ntensorflow::ops::Switch\n=======================\n\n`#include \u003ccontrol_flow_ops.h\u003e`\n\nForwards `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 [RefSwitch](/versions/r1.15/api_docs/cc/class/tensorflow/ops/ref-switch#classtensorflow_1_1ops_1_1_ref_switch) and [Merge](/versions/r1.15/api_docs/cc/class/tensorflow/ops/merge#classtensorflow_1_1ops_1_1_merge).\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- data: The 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/r1.15/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/r1.15/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| [Switch](#classtensorflow_1_1ops_1_1_switch_1aaf5ed723a26cd3b4c917701508ff4c50)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` data, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` pred)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_switch_1a6cf3e40f6e518afc71bad3f6a394199a) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_false](#classtensorflow_1_1ops_1_1_switch_1a806a04c10d9920f2f1f3b9b503d24a5c) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_true](#classtensorflow_1_1ops_1_1_switch_1a84ad96bc82bdb0ce2af402225707ca0e) | `::`[tensorflow::Output](/versions/r1.15/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### Switch\n\n```gdscript\n Switch(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input data,\n ::tensorflow::Input pred\n)\n```"]]