Maybe.
But in code like this
  with torch.cuda.amp.autocast(enabled=scaler is not None):
            loss_dict = model(images, targets)
            losses = sum(loss for loss in loss_dict.values())

        # reduce losses over all GPUs for logging purposes
        loss_dict_reduced = utils.reduce_dict(loss_dict)
        losses_reduced = sum(loss for loss in loss_dict_reduced.values())

        loss_value = losses_reduced.item()


or this
  for i, data in enumerate(train_dataloader):
        optimizer.zero_grad()
        images, targets = data[0], data[1]
        images = list(image.to(device) for image in images)
        targets = [{k: v.to(device) for k, v in t.items()} for t in targets]
        loss_dict = model(images, targets)
        loss = sum(loss for loss in loss_dict.values())
        running_loss += loss.item()
        loss.backward()
        optimizer.step()

we cannot use torch.sum at all because it sum tensor whereas loss_dict.values() is list.
If we use google we see a lot of examples where used variant loss = sum(loss for loss in loss_dict.values()) and never variant sum(loss_dict.values()). loss_dict.values pytorch - Google Search
I found another variant here https://isrc.iscas.ac.cn/gitlab/research/domain-adaption/-/commit/7fb5ee486e519de46175a44f6f67455334d4a549 but they do conversion too
        loss_dict, _ = model(images, img_metas, targets)
        losses = sum(list(loss_dict.values()))

        loss_dict_reduced = dist_utils.reduce_dict(loss_dict)

Maybe it only code style, maybe if we will use in our project variant without conversion sum(loss_dict.values()) it will not lead to unwanted effects (like errors) but I not sure