class_docstr: Parameters
  ----------
  backend: str
      "neuralnetwork" or "mlprogram"
  precision: str
      "fp16" or "fp32"
  opset_version: ct.target
      minimum_deployment_target for the ct.convert function
class_docstr_tok: ["Parameters","--","--","--","--","--","backend",":","str","``","neuralnetwork","''","or","``","mlprogram","''","precision",":","str","``","fp16","''","or","``","fp32","''","opset_version",":","ct.target","minimum_deployment_target","for","the","ct.convert","function"]
code: def check_precision(self, attr, precision):
      if precision not in _SUPPORTED_PRECISIONS:
          raise ValueError(
              f"precision {precision} not supported. Please pass one of the following values: {_SUPPORTED_PRECISIONS}"
          )
      if precision == "fp16" and self.backend == "neuralnetwork":
          raise ValueError(
              "fp16 precision is only supported in mlprogram backend."
          )
  
file_path: coremltools/coremltools/converters/mil/testing_reqs.py
imports: import os
  from typing import List
  import numpy
  import pytest
  from attrs import define, field, validators
  import coremltools
  from coremltools._deps import _HAS_TF_1, _HAS_TF_2, _HAS_TORCH
  from coremltools.converters.mil.testing_utils import macos_compatible_with_deployment_target
label_desc: Use image node_id 2 for calling the BackendConfig obj's underlying member method code with example usage: obj.check_precision(attr, precision) without return types