Fix crash at import
Fix doc gen when can not compile gpu
Merge pull request #2279 from nouiz/import_fix

Fix crash at import