I’m not sure, what I had to change, as there were a lot of minor issues, but this code should work:
class CustomDataset(Dataset):
    def __init__(self, mean=0.092, std=0.127, n_classes=10):
        self.mean = mean
        self.std = std 

    def __len__(self):
        return 100

    def __getitem__(self, idx):
        img = transforms.ToPILImage()(torch.randn(69, 69))
        x = transforms.RandomRotation(180)(img) 
        x = torchvision.transforms.Normalize(mean = self.mean, std = self.std)
        x = torchvision.transforms.ToTensor()(img).view(-1)
        x = x.view(1, 69, 69)
        y = torch.randint(0, 10, (1,))
        return x, y


class Net(nn.Module):
    def __init__(self):
        super(Net,self).__init__()
        self.layer1 = nn.Sequential(
            nn.Conv2d(1, 32, kernel_size=5, stride=1, padding=2),
            nn.ReLU(),
            nn.MaxPool2d(kernel_size=2, stride=2))
        self.layer2 = nn.Sequential(
            nn.Conv2d(32, 64, kernel_size=5, stride=1, padding=2),
            nn.ReLU(),
            nn.MaxPool2d(kernel_size=2, stride=2))
        self.drop_out = nn.Dropout()
        self.fc1 = nn.Linear(64*17*17, 100)
        self.fc2 = nn.Linear(100, 10)

    def forward(self,x):
        out = self.layer1(x)
        out = self.layer2(out)
        out = out.reshape(out.size(0), -1)
        out = self.drop_out(out)
        print(out.shape)
        out = F.relu(self.fc1(out))
        out = F.relu(self.fc2(out))

        return out


def dataset_accuracy(tensor_dataset,targets,net,loss_func):
    net.eval()
    output = net(tensor_dataset)
    
    loss = loss_func(output,torch.LongTensor(targets))

    output = output.cpu().data.numpy()
    prediction = np.argmax(output,axis=1)

    n_correct = len(np.where(targets==prediction)[0])
    n_total = len(targets)

    return n_correct/n_total, loss.item()


training_ds = CustomDataset()
training_dataloader = DataLoader(training_ds,batch_size=100, shuffle= True)

## create the instance
net = Net()
loss_func = nn.CrossEntropyLoss()
tranining_tensor = torch.stack([training_ds[i][0] for i in range(len(training_ds))])
training_labels = torch.randint(0, 10, (100,))

optimizer = optim.Adam(net.parameters(), lr=0.001, betas=(0.9, 0.999), eps=1e-04, weight_decay=1e-5, amsgrad=False)
n_epochs = 1
loss_vs_epoch = []
accuracy_vs_epoch = []

for epoch in range(n_epochs):
    net.train()
    for x,y in training_dataloader:
        optimizer.zero_grad()
        output = net(x)
        training_loss = loss_func(output, y.squeeze())
        training_loss.backward()  
        optimizer.step()

    training_accuracy, training_loss = dataset_accuracy(tranining_tensor,training_labels, net, loss_func)    

You can check the shapes and make sure your data is loaded and processed in the same shape.