Solved by tom in post #7 
              
              
                If you use triple backticks (```python) before and just the backtics (```) after your code, it will be well-formatted. 
In Jupyter: 
import torch

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

    def forward(self, encode_ou…