fn

floor

Tensor
floor(input: Tensor)
source

Element-wise floor (round toward -\infty).

Returns the greatest integer-valued float less than or equal to each entry.

Parameters

inputTensor
Input tensor.

Returns

Tensor

Element-wise result with the same shape as input.

Notes

Mathematical definition:

outi=inputi\text{out}_i = \lfloor \text{input}_i \rfloor

Gradient is zero almost everywhere and treated as zero in autograd.

Examples

>>> import lucid
>>> x = lucid.tensor([1.0, 2.0, 3.0])
>>> lucid.floor(x)
Tensor([...])