Could you run this code snippet without importing PySyft to check, if PyTorch itself is raising this error:
import torch
import torch.nn as nn

class Net(nn.Module):   
    def __init__(self):
        super(Net, self).__init__()

        self.cnn_layers = nn.Sequential(
            # Defining a 2D convolution layer
            nn.Conv2d(3, 4, kernel_size=3, stride=1, padding=1),
            nn.BatchNorm2d(4),
            nn.ReLU(inplace=True),
            nn.MaxPool2d(kernel_size=2),
            # Defining another 2D convolution layer
            nn.Conv2d(4, 4, kernel_size=4, stride=1, padding=1),
            nn.BatchNorm2d(4),
            nn.ReLU(inplace=True),
            nn.MaxPool2d(kernel_size=2),
        )

        self.linear_layers = nn.Sequential(
            nn.Linear(4 * 49 * 49, 1)
        )

    # Defining the forward pass    
    def forward(self, x):
        x = self.cnn_layers(x)
        print("X prev: ", x.shape)
        x = x.view(-1, 4*49*49)
        print("X after: ", x.shape)
        x = self.linear_layers(x)
        return x
        
# defining the model
model = Net()

# defining the optimizer
optimizer = torch.optim.Adam(model.parameters(), lr=0.07)
# defining the loss function
criterion = nn.BCEWithLogitsLoss()

output_train = model(torch.randn(1, 3, 200, 200))
loss = criterion(output_train, torch.zeros(1, 1))
loss.backward()
optimizer.step()