title: ray in Cython error: The @ray.remote decorator must be applied to either a function or to a class
body: <p>I apply ray with Cython. It shows an error:
  TypeError: The @ray.remote decorator must be applied to either a function or to a class.</p>
  <p>How to solve this problem? Thanks.</p>
  <ol>
  <li>The setup.py:</li>
  </ol>
  <pre><code>from distutils.core import setup, Extension
  from Cython.Build import cythonize
  import numpy
  
  setup(
      ext_modules=cythonize(&quot;ray_cython.pyx&quot;),
      include_dirs=[numpy.get_include()]
  )
  
  setup(
      ext_modules=[
          Extension(&quot;ray_cython&quot;, [&quot;ray_cython.c&quot;],
                    include_dirs=[numpy.get_include()]),
      ],
  )
  
  # compile by  python setup.py build_ext --inplace
  # Then run compare.py
  </code></pre>
  <ol start="2">
  <li>The ray_cython.pyx file:</li>
  </ol>
  <pre><code>from numpy import linalg as LA
  import time
  #Import package
  import ray
  
  cimport numpy as np
  np.import_array()
  DTYPE = np.int
  ctypedef np.int_t DTYPE_t
  
  
  @ray.remote
  def myfunction():
  ...
  
  </code></pre>