docstr: args:
      y_true : 4-d ndarray in [batch_size, channels, img_rows, img_cols]
      y_pred : 4-d ndarray in [batch_size, channels, img_rows, img_cols]
      threshold : [0.0, 1.0]
  return mean_squared_error, smaller the better
docstr_tok: ["args",":","y_true",":","4-d","ndarray","in","[","batch_size",",","channels",",","img_rows",",","img_cols","]","y_pred",":","4-d","ndarray","in","[","batch_size",",","channels",",","img_rows",",","img_cols","]","threshold",":","[","0.0",",","1.0","]","return","mean_squared_error",",","smaller","the","better"]
code: def __call__(self, y_pred, y_true, dim=1, threshold=None):
      """
      args:
          y_true : 4-d ndarray in [batch_size, channels, img_rows, img_cols]
          y_pred : 4-d ndarray in [batch_size, channels, img_rows, img_cols]
          threshold : [0.0, 1.0]
      return mean_squared_error, smaller the better
      """
      if threshold:
          y_pred = _binarize(y_pred, threshold)
      return torch.mean((y_pred - y_true) ** 2)
  
imports: import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 3 for calling the MSE obj's underlying member method code with example usage: obj.__call__(y_pred, y_true, dim, threshold) and returns: torch