Python - PyTorch ceil() method Last Updated : 26 May, 2020 Comments Improve Suggest changes Like Article Like Report PyTorch torch.ceil() method returns a new tensor having the ceil value of the elements of input, Which is the smallest integer larger than or equal to each element. Syntax: torch.ceil(inp, out=None) Arguments inp: This is input tensor. out: The output tensor. Return: It returns a Tensor. Let's see this concept with the help of few examples: Example 1: Python3 # Importing the PyTorch library import torch # A constant tensor of size n a = torch.FloatTensor([1.3, -5.6, 7.9, 10.1]) print(a) # Applying the ceil function and # storing the result in 'out' out = torch.ceil(a) print(out) Output: 1.3000 -5.6000 7.9000 10.1000 [torch.FloatTensor of size 4] 2 -5 8 11 [torch.FloatTensor of size 4] Example 2: Python3 # Importing the PyTorch library import torch # A constant tensor of size n a = torch.FloatTensor([1.00001, -5.699, 7.100001, 10.0001]) print(a) # Applying the ceil function and # storing the result in 'out' out = torch.ceil(a) print(out) Output: 1.0000 -5.6990 7.1000 10.0001 [torch.FloatTensor of size 4] 2 -5 8 11 [torch.FloatTensor of size 4] Comment More infoAdvertise with us Next Article Python - PyTorch ceil() method P PranchalKatiyar Follow Improve Article Tags : Python Python-PyTorch Practice Tags : python Similar Reads Python - PyTorch clamp() method PyTorch torch.clamp() method clamps all the input elements into the range [ min, max ] and return a resulting tensor. Syntax: torch.clamp(inp, min, max, out=None) Arguments inp: This is input tensor. min: This is a number and specifies the lower-bound of the range to which input to be clamped. max: 2 min read Python - PyTorch div() method PyTorch torch.div() method divides every element of the input with a constant and returns a new modified tensor. Syntax: torch.div(inp, other, out=None) Arguments inp: This is input tensor. other: This is a number to be divided to each element of input inp. out: The output tensor. Return: It returns 1 min read Python - PyTorch exp() method PyTorch torch.exp() method returns a new tensor after getting the exponent of the elements of the input tensor. Syntax: torch.exp(input, out=None) Arguments input: This is input tensor. out: The output tensor. Return: It returns a Tensor. Let's see this concept with the help of few examples: Example 1 min read Python | PyTorch cos() method PyTorch is an open-source machine learning library developed by Facebook. It is used for deep neural network and natural language processing purposes.The function torch.cos() provides support for the cosine function in PyTorch. It expects the input in radian form and the output is in the range [-1, 2 min read Python - PyTorch log() method PyTorch torch.log() method gives a new tensor having the natural logarithm of the elements of input tensor. Syntax: torch.log(input, out=None) Arguments input: This is input tensor. out: The output tensor. Return: It returns a Tensor. Let's see this concept with the help of few examples: Example 1: 1 min read Python PyTorch log2() method PyTorch log2() method computes the logarithm to the base 2 of the elements of an input tensor. Â It computes the logarithm values element-wise. Â It takes a tensor as an input and returns a new tensor with computed logarithm values. The elements of the input tensor must be between zero and the positiv 4 min read Python - PyTorch frac() method PyTorch torch.frac() method computes the fractional portion of each element in input. Syntax: torch.frac(input, out=None) Arguments input: This is input tensor. out: The output tensor. Return: It returns a Tensor. Let's see this concept with the help of few examples: Example 1: Python3 # Importing t 1 min read Python | PyTorch cosh() method PyTorch is an open-source machine learning library developed by Facebook. It is used for deep neural network and natural language processing purposes. The function torch.cosh() provides support for the hyperbolic cosine function in PyTorch. It expects the input in radian form. The input type is tens 2 min read Python | PyTorch asin() method PyTorch is an open-source machine learning library developed by Facebook. It is used for deep neural network and natural language processing purposes.The function torch.asin() provides support for the inverse sine function in PyTorch. It expects the input to be in the range [-1, 1] and gives the out 2 min read Python Pytorch full() method PyTorch is an open-source machine learning library developed by Facebook. It is used for deep neural network and natural language processing purposes. The function torch.full() returns a tensor of size size filled with fill_value. Syntax: torch.ones(size, fill_value, out=None) Parameters: size: a se 1 min read Like