Dragon - Python API


Dragon is a computation graph based distributed deep learning framework.

For using it, import as follows:

import dragon

However, it will not help you much because you do not want to learn it.

To resolve this matter, we are concerned to design diverse styles for you:


Dragon is initially as a light-weight but professional style.

Native interfaces are encouraged to manipulate the backend engine to perform the computation flexibly with data feeding or fetching.

This style involves the following components:


TensorFlow is an end-to-end open source platform for machine learning.

It is challenging to make a consistency with graph and eager execution while is practical to cover most of TensorFlow operations using our backend. We have designed several simpler mechanisms to equip for our frontend to provide exactly the same inferfaces.

This style involves the following components:


PyTorch provides straight-forward operations on research prototyping.

To bridge it, our JIT traces and dispatches the operations, as well as the rewriting of GC (Garbage Collection) to reuse the memories and operators by turns.

We are still working hard to cover the original PyTorch operators, however, a bunch of extended operators in many other frameworks can be used.

This style involves the following components:



DALI is a graph-based framework optimized for data loading, pre-processing and augmentation with cpu or gpu device.

We extend it to work with our backend as an optional data provider, which brings a better performance for both training and inference.

This integration involves the following components:


ONNX provides an open source format for AI models.

We extend it to translate our GraphIR for model exchanging and deployment, that contributes a potential compatibility between inference runtimes.

This integration involves the following components:


TensorRT optimizes the AI models for high-performance inference.

We extend it to provide a cuda inference runtime for ONNX models.

This integration involves the following components:


Module autograph : Native API for dragon.autograph namespace.

Module bitwise : Native API for dragon.bitwise namespace.

Module cuda : Native API for dragon.cuda namespace.

Module distributed : Native API for dragon.distributed namespace.

Module dlpack : Native API for dragon.dlpack namespace.

Module logging : Native API for dragon.logging namespace.

Module losses : Native API for dragon.losses namespace.

Module math : Native API for dragon.math namespace.

Module metrics : Native API for dragon.metrics namespace.

Module mps : Native API for dragon.mps namespace.

Module nn : Native API for dragon.nn namespace.

Module onnx : Native API for dragon.onnx namespace.

Module optimizers : Native API for dragon.optimizers namespace.

Module random : Native API for dragon.random namespace.

Module sysconfig : Native API for dragon.sysconfig namespace.

Module vision : Native API for dragon.vision namespace.

Module vm.dali : Virtual API for dali namespace.

Module vm.dali.ops : Virtual API for dali.ops namespace.

Module vm.tensorflow : Virtual API for tensorflow namespace.

Module vm.tensorflow.bitwise : Virtual API for tensorflow.bitwise namespace.

Module vm.tensorflow.dtypes : Virtual API for tensorflow.dtypes namespace.

Module vm.tensorflow.keras : Virtual API for tensorflow.keras namespace.

Module vm.tensorflow.linalg : Virtual API for tensorflow.linalg namespace.

Module vm.tensorflow.math : Virtual API for tensorflow.math namespace.

Module vm.tensorflow.nn : Virtual API for tensorflow.nn namespace.

Module vm.tensorflow.random : Virtual API for tensorflow.random namespace.

Module vm.tensorrt : Virtual API for tensorrt namespace.

Module vm.tensorrt.onnx : Virtual API for tensorrt.onnx namespace.

Module vm.torch : Virtual API for torch namespace.

Module vm.torch.autograd : Virtual API for torch.autograd namespace.

Module vm.torch.backends : Virtual API for torch.backends namespace.

Module vm.torch.cuda : Virtual API for torch.cuda namespace.

Module vm.torch.distributed : Virtual API for torch.distributed namespace.

Module vm.torch.jit : Virtual API for torch.jit namespace.

Module vm.torch.nn : Virtual API for torch.nn namespace.

Module vm.torch.nn.functional : Virtual API for torch.nn.functional namespace.

Module vm.torch.nn.init : Virtual API for torch.nn.init namespace.

Module vm.torch.onnx : Virtual API for torch.onnx namespace.

Module vm.torch.optim : Virtual API for torch.optim namespace.

Module vm.torch.utils.checkpoint : Virtual API for torch.utils.checkpoint namespace.

Module vm.torch.utils.dlpack : Virtual API for torch.utils.dlpack namespace.

Module vm.torchvision.ops : Virtual API for torchvision.ops namespace.