code: def test_mse(device):
      from speechbrain.nnet.losses import mse_loss
  
      predictions = torch.ones(4, 10, 8, device=device)
      targets = torch.ones(4, 10, 8, device=device)
      lengths = torch.ones(4, device=device)
      out_cost = mse_loss(predictions, targets, lengths)
      assert torch.all(torch.eq(out_cost, 0))
  
      predictions = torch.zeros(4, 10, 8, device=device)
      out_cost = mse_loss(predictions, targets, lengths)
      assert torch.all(torch.eq(out_cost, 1))
  
file_path: speechbrain/tests/unittests/test_losses.py
imports: import torch
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_mse(device) without return types