เทนเซอร์โฟลว์:: ปฏิบัติการ:: หนาแน่นBincount

#include <math_ops.h>

นับจำนวนครั้งของแต่ละค่าในอาร์เรย์จำนวนเต็ม

สรุป

ส่งออกเวกเตอร์ที่มี size ความยาวและประเภท dtype เดียวกันกับ weights หาก weights ว่างเปล่า ดัชนี i จะเก็บจำนวนครั้งที่มูลค่า i ถูกนับใน arr หาก weights ไม่ว่างเปล่า ดัชนี i จะจัดเก็บผลรวมของค่าใน weights ไว้ที่แต่ละดัชนี โดยที่ค่าที่สอดคล้องกันใน arr คือ i

ค่า arr อยู่นอกช่วง [0, ขนาด) จะถูกละเว้น

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • อินพุต: 1D หรือ 2D int Tensor
  • ขนาด: Tensor เซอร์สเกลาร์ int ไม่เป็นลบ
  • น้ำหนัก: คือ int32, int64, float32 หรือ float64 Tensor ที่มีรูปร่างเหมือนกับ arr หรือ length-0 Tensor ซึ่งในกรณีนี้จะทำหน้าที่เป็นน้ำหนักทั้งหมดเท่ากับ 1

แอ็ตทริบิวต์ทางเลือก (ดู Attrs ):

  • binary_output: บูล; ไม่ว่าเคอร์เนลควรนับลักษณะที่ปรากฏหรือจำนวนครั้งที่เกิดขึ้น

ผลตอบแทน:

  • Output : 1D Tensor ที่มีความยาวเท่ากับ size หรือ 2D Tensor ที่มี [batch_size, size ] จำนวนหรือน้ำหนักรวมของแต่ละค่าในช่วง [0, ขนาด)

ตัวสร้างและผู้ทำลาย

DenseBincount (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input size, :: tensorflow::Input weights)
DenseBincount (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input size, :: tensorflow::Input weights, const DenseBincount::Attrs & attrs)

คุณลักษณะสาธารณะ

operation
output

งานสาธารณะ

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

ฟังก์ชันคงที่สาธารณะ

BinaryOutput (bool x)

โครงสร้าง

เทนเซอร์โฟลว์ :: ops :: DenseBincount :: Attrs

ตัวตั้งค่าแอตทริบิวต์เพิ่มเติมสำหรับ DenseBincount

คุณลักษณะสาธารณะ

การดำเนินการ

Operation operation

เอาท์พุท

::tensorflow::Output output

งานสาธารณะ

หนาแน่นBincount

 DenseBincount(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input size,
  ::tensorflow::Input weights
)

หนาแน่นBincount

 DenseBincount(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input size,
  ::tensorflow::Input weights,
  const DenseBincount::Attrs & attrs
)

โหนด

::tensorflow::Node * node() const 

ตัวดำเนินการ::tensorflow::อินพุต

 operator::tensorflow::Input() const 

ตัวดำเนินการ::tensorflow::เอาต์พุต

 operator::tensorflow::Output() const 

ฟังก์ชันคงที่สาธารณะ

BinaryOutput

Attrs BinaryOutput(
  bool x
)