จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: ลายนิ้วมือ
#include <array_ops.h>
สร้างค่าลายนิ้วมือ
สรุป
สร้างค่าลายนิ้วมือของ data
op ลายนิ้วมือ พิจารณามิติแรกของ data
เป็นมิติแบทช์ และ output[i]
มีค่าลายนิ้วมือที่สร้างจากเนื้อหาใน data[i, ...]
สำหรับ i
ทั้งหมด
ลายนิ้วมือ op เขียนค่าลายนิ้วมือเป็นอาร์เรย์ไบต์ ตัวอย่างเช่น วิธีการเริ่มต้น farmhash64
จะสร้างค่าลายนิ้วมือแบบ 64 บิตในแต่ละครั้ง ค่า 8 ไบต์นี้เขียนออกมาเป็นอาร์เรย์ uint8
ขนาด 8 ตามลำดับแบบ little-endian
ตัวอย่างเช่น สมมติว่า data
มีประเภทข้อมูล DT_INT32
และรูปร่าง (2, 3, 4) และวิธีการพิมพ์ลายนิ้วมือคือ farmhash64
ในกรณีนี้ รูปร่างเอาต์พุตคือ (2, 8) โดยที่ 2 คือขนาดมิติแบทช์ของ data
และ 8 คือขนาดของค่าลายนิ้วมือแต่ละค่าในหน่วยไบต์ output[0, :]
ถูกสร้างขึ้นจากจำนวนเต็ม 12 จำนวนใน data[0, :, :]
และ output[1, :]
ในทำนองเดียวกันถูกสร้างขึ้นจากจำนวนเต็ม 12 จำนวนอื่น ๆ ใน data[1, :, :]
โปรดทราบว่าการดำเนินการนี้จะสแกนลายนิ้วมือของบัฟเฟอร์พื้นฐานดิบ และจะไม่พิมพ์ลายนิ้วมือข้อมูลเมตาของ Tensor เช่น ประเภทข้อมูลและ/หรือรูปร่าง ตัวอย่างเช่น ค่าลายนิ้วมือจะไม่เปลี่ยนแปลงภายใต้การปรับรูปร่างและบิตคาสต์ตราบใดที่มิติข้อมูลแบทช์ยังคงเหมือนเดิม:
Fingerprint(data) == Fingerprint(Reshape(data, ...))
Fingerprint(data) == Fingerprint(Bitcast(data, ...))
สำหรับข้อมูลสตริง เราควรคาดหวัง Fingerprint(data) != Fingerprint(ReduceJoin(data))
โดยทั่วไป
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- ข้อมูล: ต้องมีอันดับ 1 หรือสูงกว่า
- วิธีการ: วิธี ลายนิ้วมือ ที่ใช้โดยฝ่ายปฏิบัติการนี้ วิธีการที่มีอยู่ในปัจจุบันคือ
farmhash::fingerprint64
ผลตอบแทน:
-
Output
: Tensor
สองมิติประเภท tf.uint8
มิติข้อมูลแรกเท่ากับมิติแรกของ data
และขนาดมิติที่สองขึ้นอยู่กับอัลกอริธึมลายนิ้วมือ
คุณลักษณะสาธารณะ
งานสาธารณะ
โหนด
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# tensorflow::ops::Fingerprint Class Reference\n\ntensorflow::ops::Fingerprint\n============================\n\n`#include \u003carray_ops.h\u003e`\n\nGenerates fingerprint values.\n\nSummary\n-------\n\nGenerates fingerprint values of `data`.\n\n[Fingerprint](/versions/r2.3/api_docs/cc/class/tensorflow/ops/fingerprint#classtensorflow_1_1ops_1_1_fingerprint) op considers the first dimension of `data` as the batch dimension, and `output[i]` contains the fingerprint value generated from contents in `data[i, ...]` for all `i`.\n\n[Fingerprint](/versions/r2.3/api_docs/cc/class/tensorflow/ops/fingerprint#classtensorflow_1_1ops_1_1_fingerprint) op writes fingerprint values as byte arrays. For example, the default method `farmhash64` generates a 64-bit fingerprint value at a time. This 8-byte value is written out as an `uint8` array of size 8, in little-endian order.\n\nFor example, suppose that `data` has data type `DT_INT32` and shape (2, 3, 4), and that the fingerprint method is `farmhash64`. In this case, the output shape is (2, 8), where 2 is the batch dimension size of `data`, and 8 is the size of each fingerprint value in bytes. `output[0, :]` is generated from 12 integers in `data[0, :, :]` and similarly `output[1, :]` is generated from other 12 integers in `data[1, :, :]`.\n\nNote that this op fingerprints the raw underlying buffer, and it does not fingerprint [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor)'s metadata such as data type and/or shape. For example, the fingerprint values are invariant under reshapes and bitcasts as long as the batch dimension remain the same:\n\n\n```text\nFingerprint(data) == Fingerprint(Reshape(data, ...))\nFingerprint(data) == Fingerprint(Bitcast(data, ...))\n```\n\n\u003cbr /\u003e\n\nFor string data, one should expect `Fingerprint(data) != Fingerprint(ReduceJoin(data))` in general.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- data: Must have rank 1 or higher.\n- method: [Fingerprint](/versions/r2.3/api_docs/cc/class/tensorflow/ops/fingerprint#classtensorflow_1_1ops_1_1_fingerprint) method used by this op. Currently available method is `farmhash::fingerprint64`.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A two-dimensional [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of type `tf.uint8`. The first dimension equals to `data`'s first dimension, and the second dimension size depends on the fingerprint algorithm.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [Fingerprint](#classtensorflow_1_1ops_1_1_fingerprint_1a5a9ba3aaf3975b520b93b93f97d3218e)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` data, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` method)` ||\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [fingerprint](#classtensorflow_1_1ops_1_1_fingerprint_1acb15a2bc227362487ec02887bd37371b) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_fingerprint_1a28c7645b277237010a0c6e2b37c9e520) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_fingerprint_1a6605930068854f0e7e5ba0ad2ce90daa)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_fingerprint_1af0b4d90e2ccbff5efb796771a356e94d)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_fingerprint_1a1d72f0d143362ae62b95dfdadd166164)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### fingerprint\n\n```text\n::tensorflow::Output fingerprint\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### Fingerprint\n\n```gdscript\n Fingerprint(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input data,\n ::tensorflow::Input method\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```"]]