pytorch functions code example
Example 1: python functions
def myFunction(say):
print(say)
myFunction("Hello")
age = input("How old are you?")
myFunction("You are {} years old!".format(age))
Hello
How old are you?
>>11
You are 11 years old!
Example 2: python functions
def multiply():
product = 10.5 * 4
return product
product = multiply()
print(product)
Example 3: PyTorch
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Example 4: pytorch
from __future__ import print_function
import torch
x = torch.rand(5, 3)
print(x)