Deep Learning, Sora, Computer Vision, Transformers, Attention.
to generate this mask below First lets create a mask and fill it with zeros where-ever squence is padded. in the example about we have image3 and image 4 padded with 24 sequences. mask = torch.ones(pout.shape[:2]) mask.shape #torch.Size([4, 480]) for n, i in enumerate(out): mask[n, i.shape[1]:] = 0