संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: कहा3
#include <math_ops.h>
condition
के आधार पर x
या y
से तत्वों का चयन करता है।
सारांश
x
, और y
टेंसरों का आकार समान होना चाहिए, और आउटपुट का भी वही आकार होगा।
यदि x
और y
अदिश हैं तो condition
टेंसर एक अदिश होना चाहिए। यदि x
और y
सदिश या उच्च रैंक वाले हैं, तो condition
या तो एक अदिश होनी चाहिए, एक सदिश जिसका आकार x
के पहले आयाम से मेल खाता हो, या उसका आकार x
के समान होना चाहिए।
condition
टेंसर एक मास्क के रूप में कार्य करता है जो प्रत्येक तत्व के मूल्य के आधार पर चुनता है कि आउटपुट में संबंधित तत्व/पंक्ति को x
(यदि सत्य है) या y
(यदि गलत है) से लिया जाना चाहिए।
यदि condition
एक वेक्टर है और x
और y
उच्च रैंक मैट्रिक्स हैं, तो यह x
और y
से कॉपी करने के लिए कौन सी पंक्ति (बाहरी आयाम) चुनता है। यदि condition
आकार x
और y
के समान है, तो यह चुनता है कि x
और y
से किस तत्व की प्रतिलिपि बनाई जाए।
उदाहरण के लिए:
# 'condition' tensor is [[True, False]
# [False, True]]
# 't' is [[1, 2],
# [3, 4]]
# 'e' is [[5, 6],
# [7, 8]]
select(condition, t, e) # => [[1, 6], [7, 4]]
# 'condition' tensor is [True, False]
# 't' is [[1, 2],
# [3, 4]]
# 'e' is [[5, 6],
# [7, 8]]
select(condition, t, e) ==> [[1, 2],
[7, 8]]
Arguments:
- scope: A Scope object
- x: = A
Tensor
which may have the same shape as condition
. If condition
is rank 1, x
may have higher rank, but its first dimension must match the size of condition
.
- y: = A
Tensor
with the same type and shape as x
.
Returns:
Public attributes
सार्वजनिक समारोह
नोड
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator::tensorflow::Output() const
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::Where3 Class Reference\n\ntensorflow::ops::Where3\n=======================\n\n`#include \u003cmath_ops.h\u003e`\n\nSelects elements from `x` or `y`, depending on `condition`.\n\nSummary\n-------\n\nThe `x`, and `y` tensors must all have the same shape, and the output will also have that shape.\n\nThe `condition` tensor must be a scalar if `x` and `y` are scalars. If `x` and `y` are vectors or higher rank, then `condition` must be either a scalar, a vector with size matching the first dimension of `x`, or must have the same shape as `x`.\n\nThe `condition` tensor acts as a mask that chooses, based on the value at each element, whether the corresponding element / row in the output should be taken from `x` (if true) or `y` (if false).\n\nIf `condition` is a vector and `x` and `y` are higher rank matrices, then it chooses which row (outer dimension) to copy from `x` and `y`. If `condition` has the same shape as `x` and `y`, then it chooses which element to copy from `x` and `y`.\n\nFor example:\n\n\n```text\n# 'condition' tensor is [[True, False]\n# [False, True]]\n# 't' is [[1, 2],\n# [3, 4]]\n# 'e' is [[5, 6],\n# [7, 8]]\nselect(condition, t, e) # =\u003e [[1, 6], [7, 4]]\n```\n\n\u003cbr /\u003e\n\n\n```text\n# 'condition' tensor is [True, False]\n# 't' is [[1, 2],\n# [3, 4]]\n# 'e' is [[5, 6],\n# [7, 8]]\nselect(condition, t, e) ==\u003e [[1, 2],\n [7, 8]]\n```\n\n\u003cbr /\u003e\n\n\n````gdscript\n \n Arguments:\n \n- scope: A /versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope object\n\n \n- x: = A /versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor which may have the same shape as condition. If condition is rank 1, x may have higher rank, but its first dimension must match the size of condition.\n\n \n- y: = A /versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor with the same type and shape as x.\n\n \n\n Returns:\n \n- /versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output: = A /versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor with the same type and shape as x and y. \n\n \n\n \n\n\n \n### Constructors and Destructors\n\n\n \n\n\n\n #classtensorflow_1_1ops_1_1_where3_1a1e043e7f8493b555a94d106084a64a32(const ::/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input condition, ::/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input x, ::/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input y)\n \n\n \n\n\n \n\n\n \n### Public attributes\n\n\n \n\n\n\n #classtensorflow_1_1ops_1_1_where3_1a9b749e1046fbe4c39075a2b037391cf2\n \n\n \n\n /versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation\n \n\n \n\n\n\n #classtensorflow_1_1ops_1_1_where3_1a07742c7ad2705b0fa9b9cc9e59eca41b\n \n\n \n\n ::/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output\n \n\n \n\n\n \n\n\n \n### Public functions\n\n\n \n\n\n\n #classtensorflow_1_1ops_1_1_where3_1aacfd2a5bd041b46bc2179d3e9ac5c0c6() const \n \n\n \n\n ::tensorflow::Node *\n \n\n \n\n\n\n #classtensorflow_1_1ops_1_1_where3_1a7fcabeeb211b239288d028b587a88e54() const \n \n\n \n\n `\n` \n`\n` \n\n\n\n #classtensorflow_1_1ops_1_1_where3_1aedd6e529c7127af0c5af333ded627ab3() const \n \n\n \n\n `\n` \n`\n` \n\n\n Public attributes\n \n \n### operation\n\n\n \n```\nOperation operation\n```\n\n \n\n \n \n \n### output\n\n\n \n\n\n```text\n::tensorflow::Output output\n```\n\n \n\n \n Public functions\n \n \n### Where3\n\n\n \n\n\n```gdscript\n Where3(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input condition,\n ::tensorflow::Input x,\n ::tensorflow::Input y\n)\n```\n\n \n\n \n \n \n### node\n\n\n \n\n\n```gdscript\n::tensorflow::Node * node() const \n```\n\n \n\n \n \n \n### operator::tensorflow::Input\n\n\n \n\n\n```gdscript\n operator::tensorflow::Input() const \n```\n\n \n\n \n \n \n### operator::tensorflow::Output\n\n\n \n\n\n```gdscript\n operator::tensorflow::Output() const \n```\n\n \n\n \n\n \n\n \n````"]]