संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: बैचटूस्पेस
#include <array_ops.h>
टी प्रकार के 4-डी टेंसर के लिए बैचटूस्पेस।
सारांश
यह अधिक सामान्य BatchToSpaceND का विरासती संस्करण है।
बैच से डेटा को स्थानिक डेटा के ब्लॉक में पुनर्व्यवस्थित (परम्यूट) करता है, उसके बाद क्रॉप करता है। यह SpaceToBatch का विपरीत परिवर्तन है। अधिक विशेष रूप से, यह ऑप इनपुट टेंसर की एक प्रति आउटपुट करता है जहां batch
आयाम से मानों को स्थानिक ब्लॉकों में height
और width
आयामों में ले जाया जाता है, इसके बाद height
और width
आयामों के साथ क्रॉप किया जाता है।
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- इनपुट: आकार के साथ 4-डी टेंसर
[batch*block_size*block_size, height_pad/block_size, width_pad/block_size, depth]
ध्यान दें कि इनपुट टेंसर का बैच आकार block_size * block_size
से विभाज्य होना चाहिए। - फसलें: आकार
[2, 2]
के साथ गैर-नकारात्मक पूर्णांकों का 2-डी टेंसर। यह निर्दिष्ट करता है कि स्थानिक आयामों में मध्यवर्ती परिणाम से कितने तत्वों को निम्नानुसार काटा जाना है: crops = [[crop_top, crop_bottom], [crop_left, crop_right]]
रिटर्न:
-
Output
: आकार के साथ 4-डी [batch, height, width, depth]
, जहां: height = height_pad - crop_top - crop_bottom
width = width_pad - crop_left - crop_right
Attr block_size
एक से अधिक होना चाहिए। यह ब्लॉक आकार को इंगित करता है.
कुछ उदाहरण:
(1) आकार के निम्नलिखित इनपुट के लिए [4, 1, 1, 1]
और 2 का ब्लॉक आकार:
[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
आउटपुट टेंसर का आकार [1, 2, 2, 1]
और मान है:
x = [[[[1], [2]], [[3], [4]]]]
(2) आकार के निम्नलिखित इनपुट के लिए [4, 1, 1, 3]
और 2 का ब्लॉक आकार:
[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
आउटपुट टेंसर का आकार [1, 2, 2, 3]
और मान है:
x = [[[[1, 2, 3], [4, 5, 6]],
[[7, 8, 9], [10, 11, 12]]]]
(3) आकार [4, 2, 2, 1]
और 2 के ब्लॉक आकार के निम्नलिखित इनपुट के लिए:
x = [[[[1], [3]], [[9], [11]]],
[[[2], [4]], [[10], [12]]],
[[[5], [7]], [[13], [15]]],
[[[6], [8]], [[14], [16]]]]
आउटपुट टेंसर का आकार [1, 4, 4, 1]
और मान है:
x = [[[[1], [2], [3], [4]],
[[5], [6], [7], [8]],
[[9], [10], [11], [12]],
[[13], [14], [15], [16]]]]
(4) आकार [8, 1, 2, 1]
और 2 के ब्लॉक आकार के निम्नलिखित इनपुट के लिए:
x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
[[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]
आउटपुट टेंसर का आकार [2, 2, 4, 1]
और मान है:
x = [[[[1], [3]], [[5], [7]]],
[[[2], [4]], [[10], [12]]],
[[[5], [7]], [[13], [15]]],
[[[6], [8]], [[14], [16]]]]
सार्वजनिक गुण
सार्वजनिक समारोह
नोड
::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::BatchToSpace Class Reference\n\ntensorflow::ops::BatchToSpace\n=============================\n\n`#include \u003carray_ops.h\u003e`\n\n[BatchToSpace](/versions/r2.1/api_docs/cc/class/tensorflow/ops/batch-to-space#classtensorflow_1_1ops_1_1_batch_to_space) for 4-D tensors of type T.\n\nSummary\n-------\n\nThis is a legacy version of the more general [BatchToSpaceND](/versions/r2.1/api_docs/cc/class/tensorflow/ops/batch-to-space-n-d#classtensorflow_1_1ops_1_1_batch_to_space_n_d).\n\nRearranges (permutes) data from batch into blocks of spatial data, followed by cropping. This is the reverse transformation of SpaceToBatch. More specifically, this op outputs a copy of the input tensor where values from the `batch` dimension are moved in spatial blocks to the `height` and `width` dimensions, followed by cropping along the `height` and `width` dimensions.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: 4-D tensor with shape `[batch*block_size*block_size, height_pad/block_size, width_pad/block_size, depth]`. Note that the batch size of the input tensor must be divisible by `block_size * block_size`.\n- crops: 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies how many elements to crop from the intermediate result across the spatial dimensions as follows: \n\n ```scdoc\n crops = [[crop_top, crop_bottom], [crop_left, crop_right]]\n ```\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 4-D with shape `[batch, height, width, depth]`, where: \n\n ```scdoc\n height = height_pad - crop_top - crop_bottom\n width = width_pad - crop_left - crop_right\n ```\n\n\u003cbr /\u003e\n\nThe attr `block_size` must be greater than one. It indicates the block size.\n\nSome examples:\n\n(1) For the following input of shape `[4, 1, 1, 1]` and block_size of 2:\n\n\n```text\n[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]\n```\n\n\u003cbr /\u003e\n\nThe output tensor has shape `[1, 2, 2, 1]` and value:\n\n\n```text\nx = [[[[1], [2]], [[3], [4]]]]\n```\n\n\u003cbr /\u003e\n\n(2) For the following input of shape `[4, 1, 1, 3]` and block_size of 2:\n\n\n```text\n[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]\n```\n\n\u003cbr /\u003e\n\nThe output tensor has shape `[1, 2, 2, 3]` and value:\n\n\n```text\nx = [[[[1, 2, 3], [4, 5, 6]],\n [[7, 8, 9], [10, 11, 12]]]]\n```\n\n\u003cbr /\u003e\n\n(3) For the following input of shape `[4, 2, 2, 1]` and block_size of 2:\n\n\n```text\nx = [[[[1], [3]], [[9], [11]]],\n [[[2], [4]], [[10], [12]]],\n [[[5], [7]], [[13], [15]]],\n [[[6], [8]], [[14], [16]]]]\n```\n\n\u003cbr /\u003e\n\nThe output tensor has shape `[1, 4, 4, 1]` and value:\n\n\n```text\nx = [[[[1], [2], [3], [4]],\n [[5], [6], [7], [8]],\n [[9], [10], [11], [12]],\n [[13], [14], [15], [16]]]]\n```\n\n\u003cbr /\u003e\n\n(4) For the following input of shape `[8, 1, 2, 1]` and block_size of 2:\n\n\n```text\nx = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],\n [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]\n```\n\n\u003cbr /\u003e\n\nThe output tensor has shape `[2, 2, 4, 1]` and value:\n\n\n```text\nx = [[[[1], [3]], [[5], [7]]],\n [[[2], [4]], [[10], [12]]],\n [[[5], [7]], [[13], [15]]],\n [[[6], [8]], [[14], [16]]]]\n```\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [BatchToSpace](#classtensorflow_1_1ops_1_1_batch_to_space_1a813bf5c031d4af21a394ba903c8dd8e7)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` crops, int64 block_size)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_batch_to_space_1a4f9b292d9339c4c44142a6dcec013410) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_batch_to_space_1aacc62122ef498fc3a9ee89afdbcc6b74) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_batch_to_space_1a54c1c787b320c2f52099bc7bc02a85ed)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_batch_to_space_1a23f9170b61d8e17feb37f1615a383de2)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_batch_to_space_1a6e84c3b9b55d05ad30e6bcf376278c1d)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### BatchToSpace\n\n```gdscript\n BatchToSpace(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input crops,\n int64 block_size\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n```"]]