Event-AHU / OpenPAR

[OpenPAR] An open-source framework for Pedestrian Attribute Recognition, based on PyTorch
MIT License
63 stars 6 forks source link

Why choose the subscript is 1? --x[:,:1] #16

Closed ericyq closed 4 months ago

ericyq commented 6 months ago

if args.use_div : x = torch.cat([x[:,:1],self.part_class_embedding.to(x.dtype) + torch.zeros(x.shape[0], 1, x.shape[-1], dtype=x.dtype, device=x.device) ,x[:,1:]],dim=1)

1125178969 commented 6 months ago

is to insert the Part CLS Token between the G lobal CLS Tokn and the Visual Token

ericyq commented 6 months ago

Can the subscript number 1 become the last one? or can the subscript 1 be arbitrary?

1125178969 commented 6 months ago

It is not possible to slice x in this way, because x[:,0] represents the CLS token