<jupyter_start><jupyter_text>Playing with tensors<jupyter_code>from keras.datasets import mnist
import matplotlib.pyplot as plt

import numpy as np
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
train_images.ndim
train_images.shape
train_images.dtype
train_labels[:5]
digit = train_images[0]
digit.shape
plt.imshow(digit[7:-7, :], cmap=plt.cm.binary)
plt.show()
plt.imshow(digit)
plt.show()<jupyter_output><empty_output><jupyter_text>Broadcasting<jupyter_code>np1=np.array([1,2,3,4])
np1.shape
np2=np.array([[1,1,1,1],[1,1,1,1]])
np2+np1<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup