// get layer representations
grads = model.gradients(sess, batcher, options.target_indexes, options.layers)
print("grads", grads.shape)
// plot as heatmap
plt.figure()
sns.heatmap(grads[0,:,:])
After Change
// drop sequence dimension
for lii in range(len(layer_grads)):
layer_grads[lii] = np.squeeze(layer_grads[lii], 0)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// visualize