%matplotlib inline
Sphinx Gallery Demo#
This is a simple example demonstrating the Sphinx Gallery integration with the PyTorch Sphinx Theme.
NumPy Arrays#
Let’s create some arrays and demonstrate basic operations.
import numpy as np
First, let’s create some arrays:
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
float64
We can also create arrays with random values:
x = np.random.randn(3, 3)
print(x)
[[-0.9874212 1.03060365 -0.80337331]
[ 0.73401759 1.09739393 1.08036629]
[ 1.11315 -1.04585474 1.34063979]]
Plotting with Matplotlib#
The gallery can also display plots:
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot([1, 2, 3, 4], [1, 4, 2, 3])
ax.set_xlabel('X axis')
ax.set_ylabel('Y axis')
ax.set_title('Simple Plot')
plt.show()