forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 1
Hacking the codebase
Prasun Anand edited this page Jul 25, 2019
·
22 revisions
- https://pytorch.org/blog/a-tour-of-pytorch-internals-1/
- https://pytorch.org/blog/a-tour-of-pytorch-internals-2/
- http://blog.ezyang.com/2019/05/pytorch-internals/
- https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md
- Libtorch => https://github.com/pytorch/pytorch/blob/master/docs/libtorch.rst Note: Method2 is more viable here.
Setup.py ==>
Initialization of torch._C Link Notice the method list defined here and how methods are appended to the module Link
Other modules/objects from C extension:
- torch._C._functions
- torch._C._EngineBase
- torch._C._FunctionBase
- torch._C._LegacyVariableBase
- torch._C._CudaEventBase
- torch._C._CudaStreamBase
- torch._C.Generator
- "torch._C." THPStorageBaseStr // Note the ""
- torch._C._PtrWrapper
Check implementation of torch.tensor() i.e. (init())
- Tensor https://github.com/pytorch/pytorch/blob/e8ad167211e09b1939dcb4f462d3f03aa6a6f08a/torch/tensor.py#L20
- _TensorBase : Note this is an object added via
PyModule_AddObject
https://github.com/pytorch/pytorch/blob/e8ad167211e09b1939dcb4f462d3f03aa6a6f08a/torch/csrc/autograd/python_variable.cpp#L588
See the section on torch._C.VariableFunctions.add. THPVariable_add
in Edward's post
Torch Random Number Generators