fn
histc
→Tensorhistc(input: Tensor, bins: int = ..., min: float = ..., max: float = ...)Compute a histogram of input with bins equally-spaced bins.
Bins span [min, max] inclusive of the upper edge; values outside
the range are silently discarded. If min == max == 0 (the
default), the range is computed from the data.
Parameters
inputTensorSource tensor (floating-point).
binsint= 100Number of bins.
minfloat= 0Lower edge.
maxfloat= 0Upper edge.
min == max == 0 means "use data range".Returns
Tensor1-D int64 tensor of length bins containing counts.
Notes
Bin width is . Right edge is inclusive of the final bin only.
Examples
>>> import lucid
>>> x = lucid.tensor([0.1, 0.5, 0.9, 1.1])
>>> lucid.histc(x, bins=4, min=0, max=1)
Tensor([1, 1, 0, 1])