histogram2d(x: Tensor, y: Tensor, bins: int | tuple[int, int] = 10, range: tuple[tuple[float, float], tuple[float, float]] | None = None, density: bool = False)Implementing kernel
C++ engine symbols that back this Python API.Joint 2-D histogram of paired observations (x[i], y[i]).
Parameters
1-D x-coordinates.
1-D y-coordinates; must have the same length as
x.binsint or tuple[int, int]= 10Bin count. A single int applies to both axes; a 2-tuple sets
each axis independently. Default
10 (i.e. 10×10).rangetuple of (float, float)= None((x_lo, x_hi), (y_lo, y_hi)). When None (default)
each axis uses its own (min, max).densitybool= FalseWhen
True divide by total count × bin area to yield a
probability density (sums × bin-area = 1). Default False.Returns
tuple of Tensor(counts, x_edges, y_edges). counts shape
(bins_x, bins_y) int64 (or float64 when density).
x_edges length bins_x + 1, y_edges length
bins_y + 1.