Tensorflow.js tf.divNoNan() Function
Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment.
The tf.divNoNan() function is used to divide two Tensors element-wise and returns 0 if the denominator is 0. It supports broadcasting.
tf.divNoNan (a, b)
Parameters: This function accepts two parameters which are illustrated below:
- a: The first input tensor as the numerator.
- b: The second input tensor as the denominator. It should have the same data type as “a”.
Return Value: It returns a Tensor for the result of a/b, where a is the first Tensor and b is the second Tensor. It returns 0 if the denominator is 0.
Tensor [2, 1.6666665, 3.5, 1.6666665] Tensor [0, 0, 0, 0]
Tensor [1.5, 3, 5.5, 8.5] Tensor [0, 0, 0, 0]
My Personal Notes arrow_drop_up
Please Login to comment...