parameters: (
          ort_root: Path, build_dir: Path, use_cuda: bool,
          required_ops: typing.Optional[dict],
          op_type_impl_filter: typing.Optional[OpTypeImplFilterInterface])
docstring: Generate provider registration files.
docstring_summary: Generate provider registration files.
docstring_tokens: Generate provider registration files .
function: def _generate_provider_registrations(
          ort_root: Path, build_dir: Path, use_cuda: bool,
          required_ops: typing.Optional[dict],
          op_type_impl_filter: typing.Optional[OpTypeImplFilterInterface]):
      '''Generate provider registration files.'''
      kernel_registration_files = [Path(f) for f in
                                   op_registration_utils.get_kernel_registration_files(str(ort_root), use_cuda)]
  
      for kernel_registration_file in kernel_registration_files:
          if not kernel_registration_file.is_file():
              raise ValueError(f'Kernel registration file does not exist: {kernel_registration_file}')
  
          log.info("Processing {}".format(kernel_registration_file))
  
          reduced_path = _get_op_reduction_file_path(ort_root, build_dir, kernel_registration_file)
  
          reduced_path.parent.mkdir(parents=True, exist_ok=True)
  
          # read from original and create the reduced kernel def file with commented out lines for any kernels that are
          # not required
          with open(reduced_path, 'w') as file_to_write:
              processor = _ExcludingRegistrationProcessor(required_ops, op_type_impl_filter, file_to_write)
  
              op_registration_utils.process_kernel_registration_file(kernel_registration_file, processor)
  
              if not processor.ok():
                  # error should have already been logged so just exit
                  sys.exit(-1)
function_tokens: def _generate_provider_registrations ( ort_root : Path , build_dir : Path , use_cuda : bool , required_ops : typing . Optional [ dict ] , op_type_impl_filter : typing . Optional [ OpTypeImplFilterInterface ] ) : kernel_registration_files = [ Path ( f ) for f in op_registration_utils . get_kernel_registration_files ( str ( ort_root ) , use_cuda ) ] for kernel_registration_file in kernel_registration_files : if not kernel_registration_file . is_file ( ) : raise ValueError ( f'Kernel registration file does not exist: {kernel_registration_file}' ) log . info ( "Processing {}" . format ( kernel_registration_file ) ) reduced_path = _get_op_reduction_file_path ( ort_root , build_dir , kernel_registration_file ) reduced_path . parent . mkdir ( parents = True , exist_ok = True ) # read from original and create the reduced kernel def file with commented out lines for any kernels that are # not required with open ( reduced_path , 'w' ) as file_to_write : processor = _ExcludingRegistrationProcessor ( required_ops , op_type_impl_filter , file_to_write ) op_registration_utils . process_kernel_registration_file ( kernel_registration_file , processor ) if not processor . ok ( ) : # error should have already been logged so just exit sys . exit ( - 1 )