python_plugin

dragon.python_plugin(
  inputs,
  module_name,
  class_name,
  num_outputs=1,
  kwargs_str=None,
  no_grad=True,
  **kwargs
)[source]

Create a plugin operator from the python class.

Parameters:
  • inputs (Sequence[dragon.Tensor]) – The inputs.
  • module_name (str, required) – The name of module where defines the class.
  • class_name (str, required) – The name of class to create.
  • num_outputs (int, optional, default=1) – The number of outputs.
  • kwargs_str (str, optional) – The stringify kwargs kept for class.
  • no_grad (bool, optional, default=True) – True to truncate the gradient of inputs.
Returns:

Sequence[dragon.Tensor] – The outputs.