The location of source code for torch.mean()

∥☆過路亽.° 提交于 2021-01-27 14:51:30

问题


I'm trying to find the source code for torch.mean and am unable to find it in the pytorch github. It is under math operations but I can't find it at all.

I've looked everywhere and inspected most pages under pytorch/torch and am still unable to find it.

I even did ?? in a jupyter notebook but it just returned a useless docstring


回答1:


Since operations components are written in C++, they are not callable with operations such as ?? or "__file__" or "getsourcefile" type of operations.

The files appear to be here, written in C++:

https://github.com/pytorch/pytorch/blob/master/caffe2/operators/mean_op.cc https://github.com/pytorch/pytorch/blob/master/caffe2/operators/mean_op.h



来源:https://stackoverflow.com/questions/58786133/the-location-of-source-code-for-torch-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!