संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
टेंसरफ़्लो:: ऑप्स:: स्पार्सक्रॉस
#include <sparse_ops.h>
विरल और सघन टेंसर की सूची से विरल क्रॉस उत्पन्न करता है।
सारांश
ऑप दो सूचियाँ लेता है, एक 2D SparseTensor
की और एक 2D Tensor
की, प्रत्येक एक फीचर कॉलम की विशेषताओं का प्रतिनिधित्व करता है। यह इन सुविधाओं के बैचवाइज क्रॉस के साथ 2D SparseTensor
आउटपुट करता है।
उदाहरण के लिए, यदि इनपुट हैं
inputs[0]: SparseTensor with shape = [2, 2]
[0, 0]: "a"
[1, 0]: "b"
[1, 1]: "c"
inputs[1]: SparseTensor with shape = [2, 1]
[0, 0]: "d"
[1, 0]: "e"
inputs[2]: Tensor [["f"], ["g"]]
तो आउटपुट होगा
shape = [2, 2]
[0, 0]: "a_X_d_X_f"
[1, 0]: "b_X_e_X_g"
[1, 1]: "c_X_e_X_g"
यदि hashed_output=true तो आउटपुट होगा
shape = [2, 2]
[0, 0]: FingerprintCat64(
Fingerprint64("f"), FingerprintCat64(
Fingerprint64("d"), Fingerprint64("a")))
[1, 0]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("b")))
[1, 1]: FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("c")))
तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
- सूचकांक: 2-डी. प्रत्येक इनपुट
SparseTensor
के सूचकांक। - मान: 1-डी. प्रत्येक
SparseTensor
का मान। - आकार: 1-डी. प्रत्येक
SparseTensor
के आकार। - सघन_इनपुट: 2-डी। घने
Tensor
द्वारा दर्शाए गए कॉलम। - hashed_output: यदि सत्य है, तो स्ट्रिंग के बजाय क्रॉस का हैश लौटाता है। यह हमें स्ट्रिंग हेरफेर से बचने की अनुमति देगा।
- num_buckets: यदि hashed_output सत्य है तो इसका उपयोग किया जाता है। आउटपुट = hashed_valuenum_buckets यदि num_buckets > 0 अन्यथा hashed_value.
- हैश_की: हैश_की निर्दिष्ट करें जिसका उपयोग
FingerprintCat64
फ़ंक्शन द्वारा क्रॉस फ़िंगरप्रिंट को संयोजित करने के लिए किया जाएगा।
रिटर्न:
-
Output
आउटपुट_इंडिसेस: 2-डी। संयोजित SparseTensor
के सूचकांक। -
Output
आउटपुट_मान: 1-डी। संयोजित या हैशेड SparseTensor
के गैर-रिक्त मान। -
Output
आउटपुट_आकार: 1-डी। संयोजित SparseTensor
का आकार।
सार्वजनिक गुण
सार्वजनिक समारोह
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],[],null,["# tensorflow::ops::SparseCross Class Reference\n\ntensorflow::ops::SparseCross\n============================\n\n`#include \u003csparse_ops.h\u003e`\n\nGenerates sparse cross from a list of sparse and dense tensors.\n\nSummary\n-------\n\nThe op takes two lists, one of 2D `SparseTensor` and one of 2D [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), each representing features of one feature column. It outputs a 2D `SparseTensor` with the batchwise crosses of these features.\n\nFor example, if the inputs are \n\n```text\ninputs[0]: SparseTensor with shape = [2, 2]\n[0, 0]: \"a\"\n[1, 0]: \"b\"\n[1, 1]: \"c\"\n\ninputs[1]: SparseTensor with shape = [2, 1]\n[0, 0]: \"d\"\n[1, 0]: \"e\"\n\ninputs[2]: Tensor [[\"f\"], [\"g\"]]\n```\n\n\u003cbr /\u003e\n\nthen the output will be \n\n```scdoc\nshape = [2, 2]\n[0, 0]: \"a_X_d_X_f\"\n[1, 0]: \"b_X_e_X_g\"\n[1, 1]: \"c_X_e_X_g\"\n```\n\n\u003cbr /\u003e\n\nif hashed_output=true then the output will be \n\n```text\nshape = [2, 2]\n[0, 0]: FingerprintCat64(\n Fingerprint64(\"f\"), FingerprintCat64(\n Fingerprint64(\"d\"), Fingerprint64(\"a\")))\n[1, 0]: FingerprintCat64(\n Fingerprint64(\"g\"), FingerprintCat64(\n Fingerprint64(\"e\"), Fingerprint64(\"b\")))\n[1, 1]: FingerprintCat64(\n Fingerprint64(\"g\"), FingerprintCat64(\n Fingerprint64(\"e\"), Fingerprint64(\"c\")))\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- indices: 2-D. Indices of each input `SparseTensor`.\n- values: 1-D. values of each `SparseTensor`.\n- shapes: 1-D. Shapes of each `SparseTensor`.\n- dense_inputs: 2-D. Columns represented by dense [Tensor](/versions/r1.15/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- hashed_output: If true, returns the hash of the cross instead of the string. This will allow us avoiding string manipulations.\n- num_buckets: It is used if hashed_output is true. output = hashed_valuenum_buckets if num_buckets \\\u003e 0 else hashed_value.\n- hash_key: Specify the hash_key that will be used by the `FingerprintCat64` function to combine the crosses fingerprints.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_indices: 2-D. Indices of the concatenated `SparseTensor`.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_values: 1-D. Non-empty values of the concatenated or hashed `SparseTensor`.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) output_shape: 1-D. Shape of the concatenated `SparseTensor`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseCross](#classtensorflow_1_1ops_1_1_sparse_cross_1aed8888154d0f2d69bb849055ef8805ae)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::InputList](/versions/r1.15/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` indices, ::`[tensorflow::InputList](/versions/r1.15/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` values, ::`[tensorflow::InputList](/versions/r1.15/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` shapes, ::`[tensorflow::InputList](/versions/r1.15/api_docs/cc/class/tensorflow/input-list#classtensorflow_1_1_input_list)` dense_inputs, bool hashed_output, int64 num_buckets, int64 hash_key, DataType out_type, DataType internal_type)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_cross_1aa80e22c2b5a8b8c00fdfbed5f6da6e03) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output_indices](#classtensorflow_1_1ops_1_1_sparse_cross_1aff3e5729686b249a84f3047cd2c7b2fa) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_shape](#classtensorflow_1_1ops_1_1_sparse_cross_1a168d4af0a9f32f170b7fd033550d0d24) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [output_values](#classtensorflow_1_1ops_1_1_sparse_cross_1a811794f95c743d1e8f345356e773447a) | `::`[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_indices\n\n```scdoc\n::tensorflow::Output output_indices\n``` \n\n### output_shape\n\n```scdoc\n::tensorflow::Output output_shape\n``` \n\n### output_values\n\n```scdoc\n::tensorflow::Output output_values\n``` \n\nPublic functions\n----------------\n\n### SparseCross\n\n```gdscript\n SparseCross(\n const ::tensorflow::Scope & scope,\n ::tensorflow::InputList indices,\n ::tensorflow::InputList values,\n ::tensorflow::InputList shapes,\n ::tensorflow::InputList dense_inputs,\n bool hashed_output,\n int64 num_buckets,\n int64 hash_key,\n DataType out_type,\n DataType internal_type\n)\n```"]]