Python caffe2.python.workspace.RegisteredOperators() Examples

The following are 2 code examples of caffe2.python.workspace.RegisteredOperators(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module caffe2.python.workspace , or try the search function .
Example #1
Source File: importer.py    From ngraph-python with Apache License 2.0 6 votes vote down vote up
def _get_supported_ops(self):
        """
        Returns a list of supported ops' names.

        Arguments:

        Returns:
            List of supported ops' names.
        """
        ob = OpsBridge()
        supported_ops = set([
            name for name in dir(ob)
            if name[:1] != "_" and name not in ob.__dict__
        ])
        # common set
        supported_ops &= set(workspace.RegisteredOperators())
        return sorted(list(supported_ops)) 
Example #2
Source File: importer.py    From ngraph-python with Apache License 2.0 6 votes vote down vote up
def _get_unimplemented_ops(self):
        """
        Returns a list of unimplemented ops' names.

        Arguments:

        Returns:
            List of unimplemented ops' names.
        """
        # get required op
        ops = workspace.RegisteredOperators()
        required_ops = set(ops)

        # get unimplemented ops
        unimplemented_ops = required_ops - set(self._get_supported_ops())
        return sorted(list(unimplemented_ops))