prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add requirements check for ideep4py
  Add requirements check for iDeep4py as we do in cupy.
  Refs #4933
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `chainer/_runtime_info.py`
  Content:
  ```
  1 import platform
  2 import sys
  3 
  4 import numpy
  5 import six
  6 
  7 import chainer
  8 from chainer.backends import cuda
  9 
  10 
  11 class _RuntimeInfo(object):
  12 
  13     chainer_version = None
  14     numpy_version = None
  15     cuda_info = None
  16 
  17     def __init__(self):
  18         self.chainer_version = chainer.__version__
  19         self.numpy_version = numpy.__version__
  20         self.platform_version = platform.platform()
  21         if cuda.available:
  22             self.cuda_info = cuda.cupyx.get_runtime_info()
  23         else:
  24             self.cuda_info = None
  25 
  26     def __str__(self):
  27         s = six.StringIO()
  28         s.write('''Platform: {}\n'''.format(self.platform_version))
  29         s.write('''Chainer: {}\n'''.format(self.chainer_version))
  30         s.write('''NumPy: {}\n'''.format(self.numpy_version))
  31         if self.cuda_info is None:
  32             s.write('''CuPy: Not Available\n''')
  33         else:
  34             s.write('''CuPy:\n''')
  35             for line in str(self.cuda_info).splitlines():
  36                 s.write('''  {}\n'''.format(line))
  37         return s.getvalue()
  38 
  39 
  40 def get_runtime_info():
  41     return _RuntimeInfo()
  42 
  43 
  44 def print_runtime_info(out=None):
  45     if out is None:
  46         out = sys.stdout
  47     out.write(str(get_runtime_info()))
  48     if hasattr(out, 'flush'):
  49         out.flush()
  50
  ```
  
  Path: `chainer/backends/intel64.py`
  Content:
  ```
  1 from __future__ import absolute_import
  2 
  3 import chainer
  4 from chainer.configuration import config
  5 
  6 
  7 _ideep_version = None
  8 _error = None
  9 
  10 try:
  11     import ideep4py as ideep  # NOQA
  12     from ideep4py import mdarray  # NOQA
  13     _ideep_version = 0
  14 except ImportError as e:
  15     _error = e
  16 
  17     class mdarray(object):
  18         pass  # for type testing
  19 
  20 
  21 # ------------------------------------------------------------------------------
  22 # ideep configuration
  23 # ------------------------------------------------------------------------------
  24 _SHOULD_USE_IDEEP = {
  25     '==always': {'always': True, 'auto': False, 'never': False},
  26     '>=auto':   {'always': True, 'auto': True,  'never': False},
  27 }
  28 
  29 
  30 def is_ideep_available():
  31     """Returns if iDeep is available.
  32 
  33     Returns:
  34         bool: ``True`` if iDeep is installed.
  35     """
  36 
  37     return _ideep_version is not None
  38 
  39 
  40 def check_ideep_available():
  41     """Checks if iDeep is available.
  42 
  43     When iDeep is correctly set up, nothing happens.
  44     Otherwise it raises ``RuntimeError``.
  45     """
  46     if _ideep_version is None:
  47         # If the error is missing shared object, append a message to
  48         # redirect to the ideep website.
  49         msg = str(_error)
  50         if 'cannot open shared object file' in msg:
  51             msg += ('\n\nEnsure iDeep requirements are satisfied: '
  52                     'https://github.com/intel/ideep')
  53         raise RuntimeError(
  54             'iDeep is not available.\n'
  55             'Reason: {}: {}'.format(type(_error).__name__, msg))
  56 
  57 
  58 def should_use_ideep(level):
  59     """Determines if we should use iDeep.
  60 
  61     This function checks ``chainer.config.use_ideep`` and availability
  62     of ``ideep4py`` package.
  63 
  64     Args:
  65         level (str): iDeep use level. It must be either ``'==always'`` or
  66             ``'>=auto'``. ``'==always'`` indicates that the ``use_ideep``
  67             config must be ``'always'`` to use iDeep.
  68 
  69     Returns:
  70         bool: ``True`` if the caller should use iDeep.
  71 
  72     """
  73     if _ideep_version is None:
  74         return False
  75 
  76     # TODO(niboshi):
  77     # Add lowest_version argument and compare with ideep version.
  78     # Currently ideep does not provide a way to retrieve its version.
  79 
  80     if level not in _SHOULD_USE_IDEEP:
  81         raise ValueError('invalid iDeep use level: %s '
  82                          '(must be either of "==always" or ">=auto")' %
  83                          repr(level))
  84 
  85     flags = _SHOULD_USE_IDEEP[level]
  86 
  87     use_ideep = config.use_ideep
  88     if use_ideep not in flags:
  89         raise ValueError('invalid use_ideep configuration: %s '
  90                          '(must be either of "always", "auto", or "never")' %
  91                          repr(use_ideep))
  92     return flags[use_ideep]
  93 
  94 
  95 def inputs_all_ready(inputs, supported_ndim=(2, 4)):
  96     """Checks if input arrays are supported for an iDeep primitive.
  97 
  98     Before calling an iDeep primitive (e.g., ``ideep4py.linear.Forward``), you
  99     need to make sure that all input arrays are ready for the primitive by
  100     calling this function.
  101     Information to be checked includes array types, dimesions and data types.
  102     The function checks ``inputs`` info and ``supported_ndim``.
  103 
  104     Inputs to be tested can be any of ``Variable``, ``numpy.ndarray`` or
  105     ``ideep4py.mdarray``. However, all inputs to iDeep primitives must be
  106     ``ideep4py.mdarray``. Callers of iDeep primitives are responsible of
  107     converting all inputs to ``ideep4py.mdarray``.
  108 
  109     Args:
  110         inputs (sequence of arrays or variables):
  111             Inputs to be checked.
  112         supported_ndim (tuple of ints):
  113             Supported ndim values for the iDeep primitive.
  114 
  115     Returns:
  116         bool: ``True`` if all conditions meet.
  117 
  118     """
  119 
  120     def _is_supported_array_type(a):
  121         return isinstance(a, ideep.mdarray) or ideep.check_type([a])
  122 
  123     if _ideep_version is None:
  124         return False
  125 
  126     inputs = [x.data if isinstance(x, chainer.variable.Variable)
  127               else x for x in inputs]
  128 
  129     return (ideep.check_ndim(inputs, supported_ndim)
  130             and all([_is_supported_array_type(a) for a in inputs]))
  131
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/chainer/_runtime_info.py b/chainer/_runtime_info.py
  --- a/chainer/_runtime_info.py
  +++ b/chainer/_runtime_info.py
  @@ -6,6 +6,7 @@
   
   import chainer
   from chainer.backends import cuda
  +from chainer.backends import intel64
   
   
   class _RuntimeInfo(object):
  @@ -13,6 +14,7 @@
       chainer_version = None
       numpy_version = None
       cuda_info = None
  +    ideep_version = None
   
       def __init__(self):
           self.chainer_version = chainer.__version__
  @@ -22,6 +24,10 @@
               self.cuda_info = cuda.cupyx.get_runtime_info()
           else:
               self.cuda_info = None
  +        if intel64.is_ideep_available():
  +            self.ideep_version = intel64.ideep.__version__
  +        else:
  +            self.ideep_version = None
   
       def __str__(self):
           s = six.StringIO()
  @@ -34,6 +40,10 @@
               s.write('''CuPy:\n''')
               for line in str(self.cuda_info).splitlines():
                   s.write('''  {}\n'''.format(line))
  +        if self.ideep_version is None:
  +            s.write('''iDeep: Not Available\n''')
  +        else:
  +            s.write('''iDeep: {}\n'''.format(self.ideep_version))
           return s.getvalue()
   
   
  diff --git a/chainer/backends/intel64.py b/chainer/backends/intel64.py
  --- a/chainer/backends/intel64.py
  +++ b/chainer/backends/intel64.py
  @@ -10,9 +10,10 @@
   try:
       import ideep4py as ideep  # NOQA
       from ideep4py import mdarray  # NOQA
  -    _ideep_version = 0
  +    _ideep_version = 2 if hasattr(ideep, '__version__') else 1
   except ImportError as e:
       _error = e
  +    _ideep_version = None
   
       class mdarray(object):
           pass  # for type testing
  @@ -31,10 +32,9 @@
       """Returns if iDeep is available.
   
       Returns:
  -        bool: ``True`` if iDeep is installed.
  +        bool: ``True`` if the supported version of iDeep is installed.
       """
  -
  -    return _ideep_version is not None
  +    return _ideep_version is not None and _ideep_version == 2
   
   
   def check_ideep_available():
  @@ -53,6 +53,10 @@
           raise RuntimeError(
               'iDeep is not available.\n'
               'Reason: {}: {}'.format(type(_error).__name__, msg))
  +    elif _ideep_version != 2:
  +        raise RuntimeError(
  +            'iDeep is not available.\n'
  +            'Reason: Unsupported iDeep version ({})'.format(_ideep_version))
   
   
   def should_use_ideep(level):
  @@ -70,7 +74,7 @@
           bool: ``True`` if the caller should use iDeep.
   
       """
  -    if _ideep_version is None:
  +    if not is_ideep_available():
           return False
   
       # TODO(niboshi):
  @@ -120,7 +124,7 @@
       def _is_supported_array_type(a):
           return isinstance(a, ideep.mdarray) or ideep.check_type([a])
   
  -    if _ideep_version is None:
  +    if not is_ideep_available():
           return False
   
       inputs = [x.data if isinstance(x, chainer.variable.Variable)
  
verification_info: {"golden_diff": "diff --git a/chainer/_runtime_info.py b/chainer/_runtime_info.py\n--- a/chainer/_runtime_info.py\n+++ b/chainer/_runtime_info.py\n@@ -6,6 +6,7 @@\n \n import chainer\n from chainer.backends import cuda\n+from chainer.backends import intel64\n \n \n class _RuntimeInfo(object):\n@@ -13,6 +14,7 @@\n     chainer_version = None\n     numpy_version = None\n     cuda_info = None\n+    ideep_version = None\n \n     def __init__(self):\n         self.chainer_version = chainer.__version__\n@@ -22,6 +24,10 @@\n             self.cuda_info = cuda.cupyx.get_runtime_info()\n         else:\n             self.cuda_info = None\n+        if intel64.is_ideep_available():\n+            self.ideep_version = intel64.ideep.__version__\n+        else:\n+            self.ideep_version = None\n \n     def __str__(self):\n         s = six.StringIO()\n@@ -34,6 +40,10 @@\n             s.write('''CuPy:\\n''')\n             for line in str(self.cuda_info).splitlines():\n                 s.write('''  {}\\n'''.format(line))\n+        if self.ideep_version is None:\n+            s.write('''iDeep: Not Available\\n''')\n+        else:\n+            s.write('''iDeep: {}\\n'''.format(self.ideep_version))\n         return s.getvalue()\n \n \ndiff --git a/chainer/backends/intel64.py b/chainer/backends/intel64.py\n--- a/chainer/backends/intel64.py\n+++ b/chainer/backends/intel64.py\n@@ -10,9 +10,10 @@\n try:\n     import ideep4py as ideep  # NOQA\n     from ideep4py import mdarray  # NOQA\n-    _ideep_version = 0\n+    _ideep_version = 2 if hasattr(ideep, '__version__') else 1\n except ImportError as e:\n     _error = e\n+    _ideep_version = None\n \n     class mdarray(object):\n         pass  # for type testing\n@@ -31,10 +32,9 @@\n     \"\"\"Returns if iDeep is available.\n \n     Returns:\n-        bool: ``True`` if iDeep is installed.\n+        bool: ``True`` if the supported version of iDeep is installed.\n     \"\"\"\n-\n-    return _ideep_version is not None\n+    return _ideep_version is not None and _ideep_version == 2\n \n \n def check_ideep_available():\n@@ -53,6 +53,10 @@\n         raise RuntimeError(\n             'iDeep is not available.\\n'\n             'Reason: {}: {}'.format(type(_error).__name__, msg))\n+    elif _ideep_version != 2:\n+        raise RuntimeError(\n+            'iDeep is not available.\\n'\n+            'Reason: Unsupported iDeep version ({})'.format(_ideep_version))\n \n \n def should_use_ideep(level):\n@@ -70,7 +74,7 @@\n         bool: ``True`` if the caller should use iDeep.\n \n     \"\"\"\n-    if _ideep_version is None:\n+    if not is_ideep_available():\n         return False\n \n     # TODO(niboshi):\n@@ -120,7 +124,7 @@\n     def _is_supported_array_type(a):\n         return isinstance(a, ideep.mdarray) or ideep.check_type([a])\n \n-    if _ideep_version is None:\n+    if not is_ideep_available():\n         return False\n \n     inputs = [x.data if isinstance(x, chainer.variable.Variable)\n", "issue": "Add requirements check for ideep4py\nAdd requirements check for iDeep4py as we do in cupy.\r\nRefs #4933\n", "before_files": [{"content": "import platform\nimport sys\n\nimport numpy\nimport six\n\nimport chainer\nfrom chainer.backends import cuda\n\n\nclass _RuntimeInfo(object):\n\n    chainer_version = None\n    numpy_version = None\n    cuda_info = None\n\n    def __init__(self):\n        self.chainer_version = chainer.__version__\n        self.numpy_version = numpy.__version__\n        self.platform_version = platform.platform()\n        if cuda.available:\n            self.cuda_info = cuda.cupyx.get_runtime_info()\n        else:\n            self.cuda_info = None\n\n    def __str__(self):\n        s = six.StringIO()\n        s.write('''Platform: {}\\n'''.format(self.platform_version))\n        s.write('''Chainer: {}\\n'''.format(self.chainer_version))\n        s.write('''NumPy: {}\\n'''.format(self.numpy_version))\n        if self.cuda_info is None:\n            s.write('''CuPy: Not Available\\n''')\n        else:\n            s.write('''CuPy:\\n''')\n            for line in str(self.cuda_info).splitlines():\n                s.write('''  {}\\n'''.format(line))\n        return s.getvalue()\n\n\ndef get_runtime_info():\n    return _RuntimeInfo()\n\n\ndef print_runtime_info(out=None):\n    if out is None:\n        out = sys.stdout\n    out.write(str(get_runtime_info()))\n    if hasattr(out, 'flush'):\n        out.flush()\n", "path": "chainer/_runtime_info.py"}, {"content": "from __future__ import absolute_import\n\nimport chainer\nfrom chainer.configuration import config\n\n\n_ideep_version = None\n_error = None\n\ntry:\n    import ideep4py as ideep  # NOQA\n    from ideep4py import mdarray  # NOQA\n    _ideep_version = 0\nexcept ImportError as e:\n    _error = e\n\n    class mdarray(object):\n        pass  # for type testing\n\n\n# ------------------------------------------------------------------------------\n# ideep configuration\n# ------------------------------------------------------------------------------\n_SHOULD_USE_IDEEP = {\n    '==always': {'always': True, 'auto': False, 'never': False},\n    '>=auto':   {'always': True, 'auto': True,  'never': False},\n}\n\n\ndef is_ideep_available():\n    \"\"\"Returns if iDeep is available.\n\n    Returns:\n        bool: ``True`` if iDeep is installed.\n    \"\"\"\n\n    return _ideep_version is not None\n\n\ndef check_ideep_available():\n    \"\"\"Checks if iDeep is available.\n\n    When iDeep is correctly set up, nothing happens.\n    Otherwise it raises ``RuntimeError``.\n    \"\"\"\n    if _ideep_version is None:\n        # If the error is missing shared object, append a message to\n        # redirect to the ideep website.\n        msg = str(_error)\n        if 'cannot open shared object file' in msg:\n            msg += ('\\n\\nEnsure iDeep requirements are satisfied: '\n                    'https://github.com/intel/ideep')\n        raise RuntimeError(\n            'iDeep is not available.\\n'\n            'Reason: {}: {}'.format(type(_error).__name__, msg))\n\n\ndef should_use_ideep(level):\n    \"\"\"Determines if we should use iDeep.\n\n    This function checks ``chainer.config.use_ideep`` and availability\n    of ``ideep4py`` package.\n\n    Args:\n        level (str): iDeep use level. It must be either ``'==always'`` or\n            ``'>=auto'``. ``'==always'`` indicates that the ``use_ideep``\n            config must be ``'always'`` to use iDeep.\n\n    Returns:\n        bool: ``True`` if the caller should use iDeep.\n\n    \"\"\"\n    if _ideep_version is None:\n        return False\n\n    # TODO(niboshi):\n    # Add lowest_version argument and compare with ideep version.\n    # Currently ideep does not provide a way to retrieve its version.\n\n    if level not in _SHOULD_USE_IDEEP:\n        raise ValueError('invalid iDeep use level: %s '\n                         '(must be either of \"==always\" or \">=auto\")' %\n                         repr(level))\n\n    flags = _SHOULD_USE_IDEEP[level]\n\n    use_ideep = config.use_ideep\n    if use_ideep not in flags:\n        raise ValueError('invalid use_ideep configuration: %s '\n                         '(must be either of \"always\", \"auto\", or \"never\")' %\n                         repr(use_ideep))\n    return flags[use_ideep]\n\n\ndef inputs_all_ready(inputs, supported_ndim=(2, 4)):\n    \"\"\"Checks if input arrays are supported for an iDeep primitive.\n\n    Before calling an iDeep primitive (e.g., ``ideep4py.linear.Forward``), you\n    need to make sure that all input arrays are ready for the primitive by\n    calling this function.\n    Information to be checked includes array types, dimesions and data types.\n    The function checks ``inputs`` info and ``supported_ndim``.\n\n    Inputs to be tested can be any of ``Variable``, ``numpy.ndarray`` or\n    ``ideep4py.mdarray``. However, all inputs to iDeep primitives must be\n    ``ideep4py.mdarray``. Callers of iDeep primitives are responsible of\n    converting all inputs to ``ideep4py.mdarray``.\n\n    Args:\n        inputs (sequence of arrays or variables):\n            Inputs to be checked.\n        supported_ndim (tuple of ints):\n            Supported ndim values for the iDeep primitive.\n\n    Returns:\n        bool: ``True`` if all conditions meet.\n\n    \"\"\"\n\n    def _is_supported_array_type(a):\n        return isinstance(a, ideep.mdarray) or ideep.check_type([a])\n\n    if _ideep_version is None:\n        return False\n\n    inputs = [x.data if isinstance(x, chainer.variable.Variable)\n              else x for x in inputs]\n\n    return (ideep.check_ndim(inputs, supported_ndim)\n            and all([_is_supported_array_type(a) for a in inputs]))\n", "path": "chainer/backends/intel64.py"}], "after_files": [{"content": "import platform\nimport sys\n\nimport numpy\nimport six\n\nimport chainer\nfrom chainer.backends import cuda\nfrom chainer.backends import intel64\n\n\nclass _RuntimeInfo(object):\n\n    chainer_version = None\n    numpy_version = None\n    cuda_info = None\n    ideep_version = None\n\n    def __init__(self):\n        self.chainer_version = chainer.__version__\n        self.numpy_version = numpy.__version__\n        self.platform_version = platform.platform()\n        if cuda.available:\n            self.cuda_info = cuda.cupyx.get_runtime_info()\n        else:\n            self.cuda_info = None\n        if intel64.is_ideep_available():\n            self.ideep_version = intel64.ideep.__version__\n        else:\n            self.ideep_version = None\n\n    def __str__(self):\n        s = six.StringIO()\n        s.write('''Platform: {}\\n'''.format(self.platform_version))\n        s.write('''Chainer: {}\\n'''.format(self.chainer_version))\n        s.write('''NumPy: {}\\n'''.format(self.numpy_version))\n        if self.cuda_info is None:\n            s.write('''CuPy: Not Available\\n''')\n        else:\n            s.write('''CuPy:\\n''')\n            for line in str(self.cuda_info).splitlines():\n                s.write('''  {}\\n'''.format(line))\n        if self.ideep_version is None:\n            s.write('''iDeep: Not Available\\n''')\n        else:\n            s.write('''iDeep: {}\\n'''.format(self.ideep_version))\n        return s.getvalue()\n\n\ndef get_runtime_info():\n    return _RuntimeInfo()\n\n\ndef print_runtime_info(out=None):\n    if out is None:\n        out = sys.stdout\n    out.write(str(get_runtime_info()))\n    if hasattr(out, 'flush'):\n        out.flush()\n", "path": "chainer/_runtime_info.py"}, {"content": "from __future__ import absolute_import\n\nimport chainer\nfrom chainer.configuration import config\n\n\n_ideep_version = None\n_error = None\n\ntry:\n    import ideep4py as ideep  # NOQA\n    from ideep4py import mdarray  # NOQA\n    _ideep_version = 2 if hasattr(ideep, '__version__') else 1\nexcept ImportError as e:\n    _error = e\n    _ideep_version = None\n\n    class mdarray(object):\n        pass  # for type testing\n\n\n# ------------------------------------------------------------------------------\n# ideep configuration\n# ------------------------------------------------------------------------------\n_SHOULD_USE_IDEEP = {\n    '==always': {'always': True, 'auto': False, 'never': False},\n    '>=auto':   {'always': True, 'auto': True,  'never': False},\n}\n\n\ndef is_ideep_available():\n    \"\"\"Returns if iDeep is available.\n\n    Returns:\n        bool: ``True`` if the supported version of iDeep is installed.\n    \"\"\"\n    return _ideep_version is not None and _ideep_version == 2\n\n\ndef check_ideep_available():\n    \"\"\"Checks if iDeep is available.\n\n    When iDeep is correctly set up, nothing happens.\n    Otherwise it raises ``RuntimeError``.\n    \"\"\"\n    if _ideep_version is None:\n        # If the error is missing shared object, append a message to\n        # redirect to the ideep website.\n        msg = str(_error)\n        if 'cannot open shared object file' in msg:\n            msg += ('\\n\\nEnsure iDeep requirements are satisfied: '\n                    'https://github.com/intel/ideep')\n        raise RuntimeError(\n            'iDeep is not available.\\n'\n            'Reason: {}: {}'.format(type(_error).__name__, msg))\n    elif _ideep_version != 2:\n        raise RuntimeError(\n            'iDeep is not available.\\n'\n            'Reason: Unsupported iDeep version ({})'.format(_ideep_version))\n\n\ndef should_use_ideep(level):\n    \"\"\"Determines if we should use iDeep.\n\n    This function checks ``chainer.config.use_ideep`` and availability\n    of ``ideep4py`` package.\n\n    Args:\n        level (str): iDeep use level. It must be either ``'==always'`` or\n            ``'>=auto'``. ``'==always'`` indicates that the ``use_ideep``\n            config must be ``'always'`` to use iDeep.\n\n    Returns:\n        bool: ``True`` if the caller should use iDeep.\n\n    \"\"\"\n    if not is_ideep_available():\n        return False\n\n    # TODO(niboshi):\n    # Add lowest_version argument and compare with ideep version.\n    # Currently ideep does not provide a way to retrieve its version.\n\n    if level not in _SHOULD_USE_IDEEP:\n        raise ValueError('invalid iDeep use level: %s '\n                         '(must be either of \"==always\" or \">=auto\")' %\n                         repr(level))\n\n    flags = _SHOULD_USE_IDEEP[level]\n\n    use_ideep = config.use_ideep\n    if use_ideep not in flags:\n        raise ValueError('invalid use_ideep configuration: %s '\n                         '(must be either of \"always\", \"auto\", or \"never\")' %\n                         repr(use_ideep))\n    return flags[use_ideep]\n\n\ndef inputs_all_ready(inputs, supported_ndim=(2, 4)):\n    \"\"\"Checks if input arrays are supported for an iDeep primitive.\n\n    Before calling an iDeep primitive (e.g., ``ideep4py.linear.Forward``), you\n    need to make sure that all input arrays are ready for the primitive by\n    calling this function.\n    Information to be checked includes array types, dimesions and data types.\n    The function checks ``inputs`` info and ``supported_ndim``.\n\n    Inputs to be tested can be any of ``Variable``, ``numpy.ndarray`` or\n    ``ideep4py.mdarray``. However, all inputs to iDeep primitives must be\n    ``ideep4py.mdarray``. Callers of iDeep primitives are responsible of\n    converting all inputs to ``ideep4py.mdarray``.\n\n    Args:\n        inputs (sequence of arrays or variables):\n            Inputs to be checked.\n        supported_ndim (tuple of ints):\n            Supported ndim values for the iDeep primitive.\n\n    Returns:\n        bool: ``True`` if all conditions meet.\n\n    \"\"\"\n\n    def _is_supported_array_type(a):\n        return isinstance(a, ideep.mdarray) or ideep.check_type([a])\n\n    if not is_ideep_available():\n        return False\n\n    inputs = [x.data if isinstance(x, chainer.variable.Variable)\n              else x for x in inputs]\n\n    return (ideep.check_ndim(inputs, supported_ndim)\n            and all([_is_supported_array_type(a) for a in inputs]))\n", "path": "chainer/backends/intel64.py"}]}