I am definitely not explicitly appending any loss to an array. My optimization code verbatim is:
N, D = data.shape

# Hyperparameters
T = 4
n_iter = 500
batch_size = 10

mean_prec = 1.
dof = D
gamma = 1.5
alpha = 1.5

net = Siamese(D)
net_optim = torch.optim.Adam(net.parameters(), lr=0.05, weight_decay=1)

concentrations, means, covariances, precisions = initialization(net.forward_one(data)) 

for i in tqdm(range(n_iter)):

    net_optim.zero_grad()
    pairs, pair_labels = nnPairIdxsGenerator(data, labels, batch_size, 5)

    embedding = net.forward_one(data)

    outputs = net(embedding[pairs[:, 0]], embedding[pairs[:, 1]])

    mean_lwp, log_likelihoods = compute_expectations(
        embedding, means, precisions, concentrations)
    concentrations, means, covariances, precisions = max_probabilities(
        embedding, log_likelihoods)

    dpmm_loss = elbo(log_likelihoods, precisions, concentrations)
    net_loss = SiameseLoss(outputs, pair_labels)
    net_loss.backward(retain_graph=True)
    dpmm_loss.backward(retain_graph=True)
    net_optim.step()

If it would be useful to see the contents of the methods I am calling in the above, please let me know.
Thanks again!