1.
crop_sz=107
cos_window = torch.Tensor(np.outer(np.hanning(crop_sz), np.hanning(crop_sz))).cuda()
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
a=cos_window.data.cpu().numpy()
X=range(0,107)
Y = range(0, 107)
x,y = np.meshgrid(X,Y)
fig = plt.figure()
ax = Axes3D(fig)
ax.plot_surface(x,y,a, rstride=1, cstride=1, cmap='rainbow')
# ax.plot_surface(x,y,a,cmap=cm.coolwarm,linewith=0, antialiased=False)
# plt.plot(a[0])
plt.show()
output image: