Open In App

Python – tensorflow.math.ndtri()

Last Updated : 24 Feb, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

TensorFlow is open-source python library designed by Google to develop Machine Learning models and deep learning  neural networks. ndtri() is used to find quantile of Standard Normal.

Syntax: tf.math.ndtri(x, name)

Parameter:

  • x: It’s the input tensor. Allowed dtype for this tensor are float or double..
  • name(optional): It defines the name for the operation.

Returns: It returns Inverse error function of x.

Example 1:

Python3




# Importing the library
import tensorflow as tf
 
# Initializing the input tensor
a = tf.constant([.2, .5, .7, 1], dtype = tf.float64)
 
# Printing the input tensor
print('Input: ', a)
 
# Calculating result
res = tf.math.ndtri(x = a)
 
# Printing the result
print('Result: ', res)


Output:

Input:  tf.Tensor([0.2 0.5 0.7 1. ], shape=(4, ), dtype=float64)
Result:  tf.Tensor([-0.84162123  0.          0.52440051         inf], shape=(4, ), dtype=float64)

Example 2:

Python3




# importing the library
import tensorflow as tf
 
# Initializing the input tensor
a = tf.constant([-.1, -.2, -.5, .5, .2, .1], dtype = tf.float64)
 
# Printing the input tensor
print('Input: ', a)
 
# Calculating result
res = tf.math.ndtri(x = a)
 
# Printing the result
print('Result: ', res)


Output:

Input:  tf.Tensor([-0.1 -0.2 -0.5  0.5  0.2  0.1], shape=(6, ), dtype=float64)
Result:  tf.Tensor([       -inf        -inf        -inf  0.         -0.84162123 -1.28155157], shape=(6, ), dtype=float64)


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads