จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: RaggedBincount
#include <math_ops.h>
นับจำนวนครั้งของแต่ละค่าในอาร์เรย์จำนวนเต็ม
สรุป
ส่งออกเวกเตอร์ที่มี size
ความยาวและประเภท dtype เดียวกันกับ weights
หาก weights
ว่างเปล่า ดัชนี i
จะเก็บจำนวนครั้งที่นับค่า i
ใน arr
หาก weights
ไม่ว่างเปล่า ดัชนี i
จะจัดเก็บผลรวมของค่าใน weights
ไว้ที่แต่ละดัชนี โดยที่ค่าที่สอดคล้องกันใน arr
คือ i
ค่าที่ arr
นอกช่วง [0, ขนาด) จะถูกละเว้น
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- แยก: 1D int64
Tensor
- ค่า: 2D int
Tensor
- ขนาด:
Tensor
เกลาร์ int ไม่เป็นลบ - น้ำหนัก: คือ int32, int64, float32 หรือ float64
Tensor
ที่มีรูปร่างเหมือนกับ input
หรือ length-0 Tensor
ซึ่งในกรณีนี้จะทำหน้าที่เป็นน้ำหนักทั้งหมดเท่ากับ 1
แอ็ตทริบิวต์ทางเลือก (ดู Attrs
):
- binary_output: บูล; ไม่ว่าเคอร์เนลควรนับลักษณะที่ปรากฏหรือจำนวนครั้งที่เกิดขึ้น
ผลตอบแทน:
-
Output
: 1D Tensor
ที่มีความยาวเท่ากับ size
หรือ 2D Tensor
ที่มี [batch_size, size
] จำนวนหรือน้ำหนักรวมของแต่ละค่าในช่วง [0, ขนาด)
คุณลักษณะสาธารณะ
งานสาธารณะ
โหนด
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
BinaryOutput
Attrs BinaryOutput(
bool x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[],null,["# tensorflow::ops::RaggedBincount Class Reference\n\ntensorflow::ops::RaggedBincount\n===============================\n\n`#include \u003cmath_ops.h\u003e`\n\nCounts the number of occurrences of each value in an integer array.\n\nSummary\n-------\n\nOutputs a vector with length `size` and the same dtype as `weights`. If `weights` are empty, then index `i` stores the number of times the value `i` is counted in `arr`. If `weights` are non-empty, then index `i` stores the sum of the value in `weights` at each index where the corresponding value in `arr` is `i`.\n\nValues in `arr` outside of the range \\[0, size) are ignored.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- splits: 1D int64 [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- values: 2D int [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- size: non-negative int scalar [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor).\n- weights: is an int32, int64, float32, or float64 [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with the same shape as `input`, or a length-0 [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor), in which case it acts as all weights equal to 1.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs)):\n\n- binary_output: bool; Whether the kernel should count the appearance or number of occurrences.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 1D [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with length equal to `size` or 2D [Tensor](/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) with \\[batch_size, `size`\\]. The counts or summed weights for each value in the range \\[0, size).\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RaggedBincount](#classtensorflow_1_1ops_1_1_ragged_bincount_1af6554de96f809fccbd678adaffbc3c24)`(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)` splits, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` values, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` weights)` ||\n| [RaggedBincount](#classtensorflow_1_1ops_1_1_ragged_bincount_1ab10c029cf1e632fc88ce35a983cecd43)`(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)` splits, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` values, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` size, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` weights, const `[RaggedBincount::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_ragged_bincount_1a733325350aabe10af880482ad5e1f9e0) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_ragged_bincount_1a29aa4960a91cfce90a6ff9b5bdd8f47d) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_ragged_bincount_1ab80b688c6e079f3cb485c27bae9fc4f6)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_ragged_bincount_1a3ee830fe3366afe1d6d8185e5d362999)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_ragged_bincount_1a0258579a8e475e40192adf1f9d54b806)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [BinaryOutput](#classtensorflow_1_1ops_1_1_ragged_bincount_1a9853523da24b28968c4a53efae303ab9)`(bool x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs#structtensorflow_1_1ops_1_1_ragged_bincount_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::RaggedBincount::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/ragged-bincount/attrs) | Optional attribute setters for [RaggedBincount](/versions/r2.3/api_docs/cc/class/tensorflow/ops/ragged-bincount#classtensorflow_1_1ops_1_1_ragged_bincount). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### RaggedBincount\n\n```gdscript\n RaggedBincount(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input splits,\n ::tensorflow::Input values,\n ::tensorflow::Input size,\n ::tensorflow::Input weights\n)\n``` \n\n### RaggedBincount\n\n```gdscript\n RaggedBincount(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input splits,\n ::tensorflow::Input values,\n ::tensorflow::Input size,\n ::tensorflow::Input weights,\n const RaggedBincount::Attrs & attrs\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``` \n\nPublic static functions\n-----------------------\n\n### BinaryOutput\n\n```text\nAttrs BinaryOutput(\n bool x\n)\n```"]]