<jupyter_start><jupyter_text>Tensor Operations  Function that help in creating tensors                      torch.rand()           torch.randn()           torch.randperm()           torch.ones()           torch.zeros()           torch.eye()<jupyter_code>#importing torch and other related modules
import torch<jupyter_output><empty_output><jupyter_text>01.torch.rand Creates a tensor of given shape and fills it with random values between 0-1 and follows uniform distribution<jupyter_code>x = torch.rand(2,3)
x
y = torch.rand(1,4)
y
#z = torch.rand() # Breaks when no arguments are given<jupyter_output><empty_output><jupyter_text>02.torch.randn creates a tensor of given shape and fills it with random values but follows normal distribution<jupyter_code>x = torch.randn(2,3)
x
y = torch.randn(1,4)
y
#z = torch.randn()# Breaks when no arguments are given<jupyter_output><empty_output><jupyter_text>03.torch.randperm creates a tensor of permutation from 0 to size n-1<jupyter_code>x = torch.randperm(5)
x
y = torch.randperm(10)
y
#z = torch.randperm(1,2) # Breaks when arguments are not one<jupyter_output><empty_output><jupyter_text>04.torch.ones Creates a tensor of given shape and fill it with ones<jupyter_code>x = torch.ones(4,3)
x
y = torch.ones(2,3)
y
#z = torch.ones()
#Breaks when no arguments are given<jupyter_output><empty_output><jupyter_text>05.torch.zeros Creates a tensor of given shape and fill it with zeros<jupyter_code>x = torch.zeros(4,3)
x
y = torch.zeros(2,3)
y
# z = torch.zeros()
# Breaks when no arguments are given<jupyter_output><empty_output><jupyter_text>06.torch.eye creates a identity matrix of size n<jupyter_code>x = torch.eye(3)
x
y =torch.eye(2)
y
#z = torch.eye()
#Breaks when no arguments are given
import jovian
jovian.commit()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10412026726057906, 'fraction_numerical': 0.021714922048997772, 'mean_word_length': 4.85342019543974, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '281467', 'license': 'MIT', 'n_tokens_mistral': 648, 'n_tokens_neox': 639, 'n_words': 175, 'path': 'Assignment-1.ipynb', 'repo_name': 'Dheer08/Pytorch', 'size': '1796'}