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.fmax.html below:

torch.fmax — PyTorch 2.7 documentation

torch.fmax
torch.fmax(input, other, *, out=None) Tensor

Computes the element-wise maximum of input and other.

This is like torch.maximum() except it handles NaNs differently: if exactly one of the two elements being compared is a NaN then the non-NaN element is taken as the maximum. Only if both elements are NaN is NaN propagated.

This function is a wrapper around C++’s std::fmax and is similar to NumPy’s fmax function.

Supports broadcasting to a common shape, type promotion, and integer and floating-point inputs.

Parameters
  • input (Tensor) – the input tensor.

  • other (Tensor) – the second input tensor

Keyword Arguments

out (Tensor, optional) – the output tensor.

Example:

>>> a = torch.tensor([9.7, float('nan'), 3.1, float('nan')])
>>> b = torch.tensor([-2.2, 0.5, float('nan'), float('nan')])
>>> torch.fmax(a, b)
tensor([9.7000, 0.5000, 3.1000,    nan])
Docs

Access comprehensive developer documentation for PyTorch

View Docs Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials Resources

Find development resources and get your questions answered

View Resources

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