جریان تنسور:: عملیات:: SparseCross

#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")))
خواهد بود

استدلال ها:

  • scope: یک شی Scope
  • شاخص ها: 2-D. شاخص های هر ورودی SparseTensor .
  • مقادیر: 1-D. مقادیر هر SparseTensor
  • اشکال: 1-D. اشکال هر SparseTensor .
  • dense_inputs: 2-D. ستون هایی که با Tensor متراکم نشان داده می شوند.
  • hashed_output: اگر درست باشد، هش ضربدر را به جای رشته برمی گرداند. این به ما امکان می دهد از دستکاری رشته ها اجتناب کنیم.
  • num_buckets: اگر hashed_output درست باشد استفاده می شود. خروجی = hashed_valuenum_buckets اگر num_buckets > 0 other 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

خروجی_شاخص ها

::tensorflow::Output output_indices

خروجی_شکل

::tensorflow::Output output_shape

مقادیر_خروجی

::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
)