tensorflow:: אופס:: SparseCross
#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")))
טיעונים:
- scope: אובייקט Scope
- מדדים: 2-D. מדדים של כל קלט
SparseTensor
. - ערכים: 1-D. ערכים של כל
SparseTensor
. - צורות: 1-D. צורות של כל
SparseTensor
. - כניסות צפופות: 2-D. עמודות המיוצגות על ידי
Tensor
צפוף. - hashed_output: אם נכון, מחזיר את ה-hash של הצלב במקום המחרוזת. זה יאפשר לנו להימנע ממניפולציות של מחרוזות.
- num_buckets: הוא משמש אם hashed_output נכון. פלט = hashed_valuenum_buckets אם num_buckets > 0 אחר hashed_value.
- hash_key: ציין את ה-hash_key שישמש את הפונקציה
FingerprintCat64
לשילוב טביעות האצבע של הצלבות.
החזרות:
-
Output
פלט_מדדים: 2-D. מדדים שלSparseTensor
המשורשר. -
Output
output_values: 1-D. ערכים לא ריקים שלSparseTensor
המשורשר או הגובב. -
Output
output_shape: 1-D. צורת ה-SparseTensor
המשורשר.
בנאים והורסים | |
---|---|
SparseCross (const :: tensorflow::Scope & scope, :: tensorflow::InputList indices, :: tensorflow::InputList values, :: tensorflow::InputList shapes, :: tensorflow::InputList dense_inputs, bool hashed_output, int64 num_buckets, int64 hash_key, DataType out_type, DataType internal_type) |
תכונות ציבוריות | |
---|---|
operation | |
output_indices | |
output_shape | |
output_values |
תכונות ציבוריות
מִבצָע
Operation operation
output_indexe
::tensorflow::Output output_indices
output_shape
::tensorflow::Output output_shape
output_values
::tensorflow::Output output_values
תפקידים ציבוריים
SparseCross
SparseCross( const ::tensorflow::Scope & scope, ::tensorflow::InputList indices, ::tensorflow::InputList values, ::tensorflow::InputList shapes, ::tensorflow::InputList dense_inputs, bool hashed_output, int64 num_buckets, int64 hash_key, DataType out_type, DataType internal_type )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 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```"]]