Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug of setup.py when torch can't be imported #252

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

wyz5864
Copy link
Contributor

@wyz5864 wyz5864 commented Aug 16, 2023

setup.py里在import不到torch的时候有一个奇怪的try except(我猜可能是为了处理这里的报错 https://github.com/pytorch/pytorch/blob/v2.0.0/torch/__init__.py#L443 ),但是问题是如果环境里就是import不到torch的话就会导致拿到的include_dirs有问题,然后会在编译extension的时候报找不到头文件,比较难以发现问题的原因。除了去掉try except这里也可以考虑改成except ImportError

get_pytorch_dir函数看起来是从https://github.com/Ascend/pytorch/blob/d6623f2f5b9f592c6a2665aec840231b08e7e5be/setup.py#L95 借鉴的

@CLAassistant
Copy link

CLAassistant commented Aug 16, 2023

CLA assistant check
All committers have signed the CLA.

@wyz5864 wyz5864 requested a review from fandaoyi August 16, 2023 08:02
@mrdanielw mrdanielw self-requested a review August 28, 2023 03:33
@mrdanielw mrdanielw merged commit f950f37 into DeepLink-org:main Aug 28, 2023
11 checks passed
LeungChiNan pushed a commit to DeepLink-org/deeplink.framework.dev that referenced this pull request Dec 8, 2023
* add resnet ops 1

* fix conv2d mean and sum

* remove sync

* add binary ops and revert sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants