title: How can I solve "torch.utils.ffi is deprecated. Please use cpp extensions instead" without downgrade pytorch version?
body: <p>When I run the code below it shows me the error.
  <code>ImportError: torch.utils.ffi is deprecated. Please use cpp extensions instead.</code>
  I have been searching solution on the online. The problem is the code below working in old version of torch (0.4.1). I want to know whether it is possible to modify or replace this code for working in the new version of pytorch.</p>
  <pre><code>from torch.utils.ffi import _wrap_function
  from ._nms import lib as _lib, ffi as _ffi
  
  __all__ = []
  def _import_symbols(locals):
      for symbol in dir(_lib):
          fn = getattr(_lib, symbol)
          if callable(fn):
              locals[symbol] = _wrap_function(fn, _ffi)
          else:
              locals[symbol] = fn
          __all__.append(symbol)
  
  _import_symbols(locals())
  </code></pre>