# tensorplay.functional.fmax Source: https://www.tensorplay.cn/docs/generated/tensorplay.functional.fmax.html ```python tensorplay.functional.fmax(input, other, *, out=None) → Tensor ``` Computes the element-wise maximum of input and other. This is like tensorplay.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](/docs/notes/broadcasting.html#broadcasting-semantics), type promotion, and integer and floating-point inputs. Parameters: - input ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the input tensor. - other ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – the second input tensor Keyword Arguments: out ([Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – the output tensor. Example: ``` >>> a = tensorplay.tensor([9.7, float('nan'), 3.1, float('nan')]) >>> b = tensorplay.tensor([-2.2, 0.5, float('nan'), float('nan')]) >>> tensorplay.fmax(a, b) tensor([9.7000, 0.5000, 3.1000, nan]) ```