diff --git a/pytorch/Basic/Tensor/README.md b/pytorch/Basic/Tensor/README.md new file mode 100644 index 0000000..75fbdfa --- /dev/null +++ b/pytorch/Basic/Tensor/README.md @@ -0,0 +1,4 @@ +There are two things that pytorch Tensors have that numpy arrays lack: +1. pytorch Tensors can live on either GPU or CPU (numpy is cpu-only); +2. pytorch can automatically track tensor computations to enable automatic differentiation; + diff --git a/pytorch/Basic/Tensor/tensor.py b/pytorch/Basic/Tensor/tensor.py new file mode 100644 index 0000000..953774b --- /dev/null +++ b/pytorch/Basic/Tensor/tensor.py @@ -0,0 +1,5 @@ +import math +import numpy as np +import torch +from matplotlib import pyplot as plt +