تدفق التوتر:: العمليات:: متفرق

#include <sparse_ops.h>

يولد تقاطعًا متفرقًا من قائمة الموترات المتناثرة والكثيفة.

ملخص

تأخذ العملية قائمتين، واحدة من 2D SparseTensor وواحدة من 2D Tensor ، تمثل كل منهما ميزات عمود ميزة واحد. يقوم بإخراج 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-D. الأعمدة التي يمثلها Tensor كثيفة.
  • hashed_output: إذا كان صحيحًا، فسيتم إرجاع تجزئة التقاطع بدلاً من السلسلة. هذا سيسمح لنا بتجنب التلاعب بالسلسلة.
  • num_buckets: يتم استخدامه إذا كان hashed_output صحيحًا. الإخراج = hashed_valuenum_buckets إذا كان num_buckets > 0 قيمة hashed_value.
  • hash_key: حدد hash_key الذي ستستخدمه وظيفة FingerprintCat64 لدمج بصمات الأصابع المتقاطعة.

عائدات:

  • مؤشرات Output : 2-D. مؤشرات SparseTensor المتسلسلة.
  • قيم إخراج Output : 1-D. القيم غير الفارغة لـ SparseTensor المتسلسلة أو المجزأة.
  • شكل Output : 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

input_indices

::tensorflow::Output output_indices

input_shape

::tensorflow::Output output_shape

input_values

::tensorflow::Output output_values

الوظائف العامة

متفرق

 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
)