Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions
dnnlowp::Histogram Class Reference

bin_width = (max - min)/nbins ith bin (zero-based indexing) contains [i*bin_width, (i+1)*bin_width) with an exception that (nbins - 1)th bin contains [(nbins-1)*bin_width, nbins*bin_width] More...

#include <dynamic_histogram.h>

Public Member Functions

 Histogram (int nbins, float min, float max)
 
 Histogram (float min, float max, const std::vector< uint64_t > &bins)
 
void Add (float f, uint64_t cnt=1)
 
void Add (const float *f, int len)
 This version collects histogram with multiple threads using per-thread histogram with privatization. More...
 
float Min () const
 
float Max () const
 
void Finalize ()
 Reduce per-thread histogram. More...
 
const std::vector< uint64_t > * GetHistogram () const
 

Detailed Description

bin_width = (max - min)/nbins ith bin (zero-based indexing) contains [i*bin_width, (i+1)*bin_width) with an exception that (nbins - 1)th bin contains [(nbins-1)*bin_width, nbins*bin_width]

Make sure to call Finalize before GetHistogram to reduce per-thread histogram.

Definition at line 17 of file dynamic_histogram.h.

Member Function Documentation

void dnnlowp::Histogram::Add ( const float *  f,
int  len 
)

This version collects histogram with multiple threads using per-thread histogram with privatization.

We should call Finalize before GetHistogram to reduce per-thread histogram.

Definition at line 27 of file dynamic_histogram.cc.

void dnnlowp::Histogram::Finalize ( )

Reduce per-thread histogram.

Need to call this before GetHistogram when the version of Add with multiple threads was used.

Definition at line 72 of file dynamic_histogram.cc.


The documentation for this class was generated from the following files: