parameters: (model, input_shape, output_dir='my-hls-test', project_name='myproject', input_data_tb=None,
                               output_data_tb=None, backend='Vivado', hls_config={}, **kwargs)
return_statement: return pytorch_to_hls(config)
docstring: Convert a Pytorch model to a hls model.
  
      Parameters
      ----------
      model : Pytorch model object.
          Model to be converted to hls model object.
      input_shape : @todo: to be filled
      output_dir (str, optional): Output directory of the generated HLS
          project. Defaults to 'my-hls-test'.
      project_name (str, optional): Name of the HLS project.
          Defaults to 'myproject'.
      input_data_tb (str, optional): String representing the path of input data in .npy or .dat format that will be
          used during csim and cosim.
      output_data_tb (str, optional): String representing the path of output data in .npy or .dat format that will be
          used during csim and cosim.
      backend (str, optional): Name of the backend to use, e.g., 'Vivado'
          or 'Quartus'.
      board (str, optional): One of target boards specified in `supported_board.json` file. If set to `None` a default
          device of a backend will be used. See documentation of the backend used.
      part (str, optional): The FPGA part. If set to `None` a default part of a backend will be used.
          See documentation of the backend used. Note that if `board` is specified, the part associated to that board
          will overwrite any part passed as a parameter.
      clock_period (int, optional): Clock period of the design.
          Defaults to 5.
      io_type (str, optional): Type of implementation used. One of
          'io_parallel' or 'io_serial'. Defaults to 'io_parallel'.
      hls_config (dict, optional): The HLS config.
      kwargs** (dict, optional): Additional parameters that will be used to create the config of the specified backend
  
      Returns
      -------
      ModelGraph : hls4ml model object.
  
      See Also
      --------
      hls4ml.convert_from_keras_model, hls4ml.convert_from_onnx_model
  
      Examples
      --------
      >>> import hls4ml
      >>> config = hls4ml.utils.config_from_pytorch_model(model, granularity='model')
      >>> hls_model = hls4ml.converters.convert_from_pytorch_model(model, hls_config=config)
  
      Notes
      -----
      Only sequential Pytorch models are supported for now.
function: def convert_from_pytorch_model(model, input_shape, output_dir='my-hls-test', project_name='myproject', input_data_tb=None,
                               output_data_tb=None, backend='Vivado', hls_config={}, **kwargs):
      """
  
      Convert a Pytorch model to a hls model.
  
      Parameters
      ----------
      model : Pytorch model object.
          Model to be converted to hls model object.
      input_shape : @todo: to be filled
      output_dir (str, optional): Output directory of the generated HLS
          project. Defaults to 'my-hls-test'.
      project_name (str, optional): Name of the HLS project.
          Defaults to 'myproject'.
      input_data_tb (str, optional): String representing the path of input data in .npy or .dat format that will be
          used during csim and cosim.
      output_data_tb (str, optional): String representing the path of output data in .npy or .dat format that will be
          used during csim and cosim.
      backend (str, optional): Name of the backend to use, e.g., 'Vivado'
          or 'Quartus'.
      board (str, optional): One of target boards specified in `supported_board.json` file. If set to `None` a default
          device of a backend will be used. See documentation of the backend used.
      part (str, optional): The FPGA part. If set to `None` a default part of a backend will be used.
          See documentation of the backend used. Note that if `board` is specified, the part associated to that board
          will overwrite any part passed as a parameter.
      clock_period (int, optional): Clock period of the design.
          Defaults to 5.
      io_type (str, optional): Type of implementation used. One of
          'io_parallel' or 'io_serial'. Defaults to 'io_parallel'.
      hls_config (dict, optional): The HLS config.
      kwargs** (dict, optional): Additional parameters that will be used to create the config of the specified backend
  
      Returns
      -------
      ModelGraph : hls4ml model object.
  
      See Also
      --------
      hls4ml.convert_from_keras_model, hls4ml.convert_from_onnx_model
  
      Examples
      --------
      >>> import hls4ml
      >>> config = hls4ml.utils.config_from_pytorch_model(model, granularity='model')
      >>> hls_model = hls4ml.converters.convert_from_pytorch_model(model, hls_config=config)
  
      Notes
      -----
      Only sequential Pytorch models are supported for now.
      """
  
      config = create_config(
          output_dir=output_dir,
          project_name=project_name,
          backend=backend,
          **kwargs
      )
  
      config['PytorchModel'] = model
      config['InputShape'] = input_shape
      config['InputData'] = input_data_tb
      config['OutputPredictions'] = output_data_tb
      config['HLSConfig'] = {}
  
      model_config = hls_config.get('Model', None)
      config['HLSConfig']['Model'] = _check_model_config(model_config)
  
      _check_hls_config(config, hls_config)
  
      return pytorch_to_hls(config)
function_tokens: def convert_from_pytorch_model ( model , input_shape , output_dir = 'my-hls-test' , project_name = 'myproject' , input_data_tb = None , output_data_tb = None , backend = 'Vivado' , hls_config = { } , * * kwargs ) : config = create_config ( output_dir = output_dir , project_name = project_name , backend = backend , * * kwargs ) config [ 'PytorchModel' ] = model config [ 'InputShape' ] = input_shape config [ 'InputData' ] = input_data_tb config [ 'OutputPredictions' ] = output_data_tb config [ 'HLSConfig' ] = { } model_config = hls_config . get ( 'Model' , None ) config [ 'HLSConfig' ] [ 'Model' ] = _check_model_config ( model_config ) _check_hls_config ( config , hls_config ) return pytorch_to_hls ( config )