Add reshape nn.Module - PyTorch Forums
discuss.pytorch.org › t › add-reshape-nn-moduleAug 21, 2019 · Add reshape nn.Module. dashesy (dashesy) August 21, 2019, 1:32am #1. Looking at the torchvision.models.resnet34 this is forward: class ResNet (nn.Module): def forward (self, x): x = self.conv1 (x) x = self.bn1 (x) x = self.relu (x) x = self.maxpool (x) x = self.layer1 (x) x = self.layer2 (x) x = self.layer3 (x) x = self.layer4 (x) x = self ...
Add reshape nn.Module - PyTorch Forums
https://discuss.pytorch.org/t/add-reshape-nn-module/5388121.08.2019 · Thanks. I added to that thread. It is a simple module, but if it is part of torch.nn the likelyhood of simppler implementation would be higher.. Relying on forward is good if you own the code, or if there is no standard layers you want to manipulate. But if for example you want to take official resnet34 and do something to it, suddenly you realize that some part of the model is in …
torch.reshape — PyTorch 1.10.1 documentation
pytorch.org › docs › stabletorch.reshape — PyTorch 1.10.0 documentation torch.reshape torch.reshape(input, shape) → Tensor Returns a tensor with the same data and number of elements as input , but with the specified shape. When possible, the returned tensor will be a view of input. Otherwise, it will be a copy.