moskomule / anatome

Ἀνατομή is a PyTorch library to analyze representation of neural networks
MIT License
61 stars 6 forks source link

why did call contiguous? #24

Closed brando90 closed 2 years ago

brando90 commented 2 years ago

I was wondering why call contiguous after flattening?

        self_tensor = self_tensor.flatten(start_dim=2, end_dim=-1).contiguous()
        other_tensor = other_tensor.flatten(start_dim=2, end_dim=-1).contiguous()

but why not after downsampling:

        downsample_method = downsample_method or 'avg_pool'
        self_tensor = self._downsample_4d(self_tensor, size, downsample_method)
        other_tensor = self._downsample_4d(other_tensor, size, downsample_method)

and thus wondering if I should always call continuous.

moskomule commented 2 years ago

No specific reason.