JuanFMontesinos:

Based on the code i’ve seen everone uses python lists


Thanks, this is exactly what i’m worry about. Is  there an alternative to python lists when we are dealing with tensor running on GPU?
An example
    def forward(self, xx, neg):
        # xx shape [View, B, C, H, W]
        # neg shape [B, C, H, W]

        xx = xx.transpose(0, 1)
        combined_views = []
        for v in xx:
            v = self.base(v)
            v = self.avgpool(v)
            v = v.view(v.size(0), -1)
            combined_views.append(v)
        p_view = combined_views[0]
        for i in range(1, len(combined_views)):
            p_view = torch.max(p_view , combined_views[i])

where is this combined_views located?