code: def accuracy_thresh_expand(
      y_pred: Tensor,
      y_true: Tensor,
      thresh: float = 0.5,
      sigmoid: bool = True,
  ):
      "Compute thresholded accuracy after expanding `y_true` to the size of `y_pred`."
      if sigmoid:
          y_pred = y_pred.sigmoid()
      return (
          (
              (y_pred > thresh).byte()
              == y_true[:, None].expand_as(y_pred).byte()
          )
          .float()
          .mean()
      )
  
imports: from __future__ import annotations
  from ..basics import *
  from .all import *
label_desc: Use image node_id 6 for calling a global function with example usage: accuracy_thresh_expand(y_pred, y_true, thresh, sigmoid) and returns: unknown