Building network components in PyTorch