Hi,
You can just initialize it with a python 0.
I haven’t run it, but the following code should work 
def calc_loss(Y_pred, Y_true, criteria, lambdas):
    #  Y_pred: the output from the network
    #  Y_true: the target values
    #  criteria: an iterable of pytorch loss criteria, e.g. [torch.nn.MSELoss(), torch.nn.L1Loss()]
    #  lambdas:  a list of regularization parameters
    assert len(criteria) == len(lambdas), "Must have the same number of criteria as lambdas"
    loss = 0
    for i in range(len(criteria)):
        loss += loss lambdas[i] * criteria[i](Y_pred, Y_true)
    return loss