A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pytorch.org/docs/stable/generated/torch.floor_divide.html below:

torch.floor_divide — PyTorch 2.8 documentation

Note

Before PyTorch 1.13 torch.floor_divide() incorrectly performed truncation division. To restore the previous behavior use torch.div() with rounding_mode='trunc'.

Computes input divided by other, elementwise, and floors the result.

out i = floor ( input i other i ) \text{{out}}_i = \text{floor} \left( \frac{{\text{{input}}_i}}{{\text{{other}}_i}} \right) outi=floor(otheriinputi)

Supports broadcasting to a common shape, type promotion, and integer and float inputs.

Parameters
Keyword Arguments

out (Tensor, optional) – the output tensor.

Example:

>>> a = torch.tensor([4.0, 3.0])
>>> b = torch.tensor([2.0, 2.0])
>>> torch.floor_divide(a, b)
tensor([2.0, 1.0])
>>> torch.floor_divide(a, 1.4)
tensor([2.0, 2.0])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4