parameters: (self, *inputs)
docstring: Updates the internal evaluation result with the inputs: 'y_pred', 'y' and 'label_idx'.
  
          Args:
              inputs: Input 'y_pred', 'y' and 'label_idx'. 'y_pred' and 'y' are a `Tensor`, list or
                          numpy.ndarray.  'y_pred' is the predicted binary image. 'y' is the actual
                          binary image. Data type of 'label_idx' is int or float.
  
          Raises:
              ValueError: If the number of the inputs is not 3.
              TypeError: If the data type of label_idx is not int or float.
              ValueError: If the value of label_idx is not in y_pred or y.
              ValueError: If y_pred and y have different shapes.
docstring_summary: Updates the internal evaluation result with the inputs: 'y_pred', 'y' and 'label_idx'.
docstring_tokens: Updates the internal evaluation result with the inputs : y_pred y and label_idx .
function: def update(self, *inputs):
          """
          Updates the internal evaluation result with the inputs: 'y_pred', 'y' and 'label_idx'.
  
          Args:
              inputs: Input 'y_pred', 'y' and 'label_idx'. 'y_pred' and 'y' are a `Tensor`, list or
                          numpy.ndarray.  'y_pred' is the predicted binary image. 'y' is the actual
                          binary image. Data type of 'label_idx' is int or float.
  
          Raises:
              ValueError: If the number of the inputs is not 3.
              TypeError: If the data type of label_idx is not int or float.
              ValueError: If the value of label_idx is not in y_pred or y.
              ValueError: If y_pred and y have different shapes.
          """
          self._is_update = True
  
          if len(inputs) != 3:
              raise ValueError("For 'HausdorffDistance.update', it needs 3 inputs (predicted value, true value, "
                               "label index), but got {}.".format(len(inputs)))
  
          y_pred = self._convert_data(inputs[0])
          y = self._convert_data(inputs[1])
          label_idx = inputs[2]
  
          if not isinstance(label_idx, (int, float)):
              raise ValueError(f"For 'HausdorffDistance.update', the label index (input[2]) must be int or float, "
                               f"but got {type(label_idx)}.")
  
          if label_idx not in y_pred and label_idx not in y:
              raise ValueError("For 'HausdorffDistance.update', the label index (input[2]) should be in predicted "
                               "value (input[0]) or true value (input[1]), but {} is not.".format(label_idx))
  
          if y_pred.size == 0 or y_pred.shape != y.shape:
              raise ValueError(f"For 'HausdorffDistance.update', the size of predicted value (input[0]) and true value "
                               f"(input[1]) should be greater than 0, in addition to that, predicted value and true "
                               f"value should have the same shape, but got predicted value size: {y_pred.size}, shape: "
                               f"{y_pred.shape}, true value size: {y.size}, shape: {y.shape}.")
  
          y_pred = (y_pred == label_idx) if y_pred.dtype is not bool else y_pred
          y = (y == label_idx) if y.dtype is not bool else y
  
          self.y_pred_edges, self.y_edges = self._get_mask_edges_distance(y_pred, y)
function_tokens: def update ( self , * inputs ) : self . _is_update = True if len ( inputs ) != 3 : raise ValueError ( "For 'HausdorffDistance.update', it needs 3 inputs (predicted value, true value, " "label index), but got {}." . format ( len ( inputs ) ) ) y_pred = self . _convert_data ( inputs [ 0 ] ) y = self . _convert_data ( inputs [ 1 ] ) label_idx = inputs [ 2 ] if not isinstance ( label_idx , ( int , float ) ) : raise ValueError ( f"For 'HausdorffDistance.update', the label index (input[2]) must be int or float, " f"but got {type(label_idx)}." ) if label_idx not in y_pred and label_idx not in y : raise ValueError ( "For 'HausdorffDistance.update', the label index (input[2]) should be in predicted " "value (input[0]) or true value (input[1]), but {} is not." . format ( label_idx ) ) if y_pred . size == 0 or y_pred . shape != y . shape : raise ValueError ( f"For 'HausdorffDistance.update', the size of predicted value (input[0]) and true value " f"(input[1]) should be greater than 0, in addition to that, predicted value and true " f"value should have the same shape, but got predicted value size: {y_pred.size}, shape: " f"{y_pred.shape}, true value size: {y.size}, shape: {y.shape}." ) y_pred = ( y_pred == label_idx ) if y_pred . dtype is not bool else y_pred y = ( y == label_idx ) if y . dtype is not bool else y self . y_pred_edges , self . y_edges = self . _get_mask_edges_distance ( y_pred , y )