How to use the x2paddle.decoder.onnx_backend.Caffe2Backend function in x2paddle

To help you get started, we’ve selected a few x2paddle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
elif core.IsGPUDeviceType(device.type):
            return workspace.has_gpu_support
        return False

    @classmethod
    def is_compatible(cls, model, device='CPU', **kwargs):
        if hasattr(super(Caffe2Backend, cls), 'is_compatible') \
           and callable(super(Caffe2Backend, cls).is_compatible):
            if not super(Caffe2Backend, cls).is_compatible(
                    model, device, **kwargs):
                return False
        # TODO: should have an unspported list of operators, be optimistic for now
        return True


prepare = Caffe2Backend.prepare

prepare_zip_archive = Caffe2Backend.prepare_zip_archive

run_node = Caffe2Backend.run_node

run_model = Caffe2Backend.run_model

supports_device = Caffe2Backend.supports_device  # noqa

is_compatible = Caffe2Backend.is_compatible
github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
    @classmethod
    def is_compatible(cls, model, device='CPU', **kwargs):
        if hasattr(super(Caffe2Backend, cls), 'is_compatible') \
           and callable(super(Caffe2Backend, cls).is_compatible):
            if not super(Caffe2Backend, cls).is_compatible(
                    model, device, **kwargs):
                return False
        # TODO: should have an unspported list of operators, be optimistic for now
        return True


prepare = Caffe2Backend.prepare

prepare_zip_archive = Caffe2Backend.prepare_zip_archive

run_node = Caffe2Backend.run_node

run_model = Caffe2Backend.run_model

supports_device = Caffe2Backend.supports_device  # noqa

is_compatible = Caffe2Backend.is_compatible
github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
def is_compatible(cls, model, device='CPU', **kwargs):
        if hasattr(super(Caffe2Backend, cls), 'is_compatible') \
           and callable(super(Caffe2Backend, cls).is_compatible):
            if not super(Caffe2Backend, cls).is_compatible(
                    model, device, **kwargs):
                return False
        # TODO: should have an unspported list of operators, be optimistic for now
        return True
github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
return False
        # TODO: should have an unspported list of operators, be optimistic for now
        return True


prepare = Caffe2Backend.prepare

prepare_zip_archive = Caffe2Backend.prepare_zip_archive

run_node = Caffe2Backend.run_node

run_model = Caffe2Backend.run_model

supports_device = Caffe2Backend.supports_device  # noqa

is_compatible = Caffe2Backend.is_compatible
github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
elif onnx_arg.HasField('g'):
        return Caffe2Backend._graph_to_net(onnx_arg.g,
                                           Caffe2Backend._known_opset_version)
    elif len(onnx_arg.floats):
        return list(onnx_arg.floats)
    elif len(onnx_arg.ints):
        return list(onnx_arg.ints)
    elif len(onnx_arg.strings):
        return list(onnx_arg.strings)
    elif len(onnx_arg.graphs):
        retval = []
        # TODO: this doesn't work with RNN ops
        for g in onnx_arg.graphs:
            retval.append(
                Caffe2Backend._graph_to_net(g,
                                            Caffe2Backend._known_opset_version))
        return retval
    else:
        raise ValueError("Unsupported ONNX attribute: {}".format(onnx_arg))
github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
if not super(Caffe2Backend, cls).is_compatible(
                    model, device, **kwargs):
                return False
        # TODO: should have an unspported list of operators, be optimistic for now
        return True


prepare = Caffe2Backend.prepare

prepare_zip_archive = Caffe2Backend.prepare_zip_archive

run_node = Caffe2Backend.run_node

run_model = Caffe2Backend.run_model

supports_device = Caffe2Backend.supports_device  # noqa

is_compatible = Caffe2Backend.is_compatible
github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
return False

    @classmethod
    def is_compatible(cls, model, device='CPU', **kwargs):
        if hasattr(super(Caffe2Backend, cls), 'is_compatible') \
           and callable(super(Caffe2Backend, cls).is_compatible):
            if not super(Caffe2Backend, cls).is_compatible(
                    model, device, **kwargs):
                return False
        # TODO: should have an unspported list of operators, be optimistic for now
        return True


prepare = Caffe2Backend.prepare

prepare_zip_archive = Caffe2Backend.prepare_zip_archive

run_node = Caffe2Backend.run_node

run_model = Caffe2Backend.run_model

supports_device = Caffe2Backend.supports_device  # noqa

is_compatible = Caffe2Backend.is_compatible
github PaddlePaddle / X2Paddle / x2paddle / decoder / onnx_backend.py View on Github external
if hasattr(super(Caffe2Backend, cls), 'is_compatible') \
           and callable(super(Caffe2Backend, cls).is_compatible):
            if not super(Caffe2Backend, cls).is_compatible(
                    model, device, **kwargs):
                return False
        # TODO: should have an unspported list of operators, be optimistic for now
        return True


prepare = Caffe2Backend.prepare

prepare_zip_archive = Caffe2Backend.prepare_zip_archive

run_node = Caffe2Backend.run_node

run_model = Caffe2Backend.run_model

supports_device = Caffe2Backend.supports_device  # noqa

is_compatible = Caffe2Backend.is_compatible