-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Updated C wrapper wrt. Torch v1.10 #61
Commits on Nov 12, 2023
-
Added wrapper generator from ocaml-torch 0.14
Copied from https://github.com/LaurentMazare/ocaml-torch/tree/a6499811f40282a071179d4306afbbb6023dcc4a/src/gen/gen.ml Also updated dune-project accordingly.
Configuration menu - View commit details
-
Copy full SHA for 28550c8 - Browse repository at this point
Copy the full SHA 28550c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 57ded88 - Browse repository at this point
Copy the full SHA 57ded88View commit details -
Configuration menu - View commit details
-
Copy full SHA for f374bf6 - Browse repository at this point
Copy the full SHA f374bf6View commit details
Commits on Apr 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7828132 - Browse repository at this point
Copy the full SHA 7828132View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0b551ea - Browse repository at this point
Copy the full SHA 0b551eaView commit details
Commits on Apr 29, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f82525a - Browse repository at this point
Copy the full SHA f82525aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 075ecf7 - Browse repository at this point
Copy the full SHA 075ecf7View commit details -
Changed return type of functions to status code
A. Non-void, non-* methods. Search/replace: 1. torch_api.h: ^(?!void)(\w+) (at.+)\( -> int $2($1 *, 2. torch_api.h: , \);$ -> ); 3. torch_api.cpp: ^(?!void)(\w+) (at.+)\( -> int $2($1 *out__, 4. torch_api.cpp: , \) \{$ -> ) { B. void-methods. Search/replace 1. torch_api.{h,cpp}: ^void (at.+)\( -> int $1( C. *-methods. Search/replace 1. torch.api.h: ^(\w+ \*)(at.+)\( -> int $2($1*, 2. torch_api.cpp: ^(\w+ \*)(at.+)\( -> int $2($1*out__, D. Implemented return status code Replaced ``` ^(\s*) return new (.+) \s*\) \s*return nullptr; ``` with ``` $1 out__[0] = new $2 $1 return 0; $1) $1return 1; ``` E. Implemented return status code 1. Replaced ``` ^(\s*)PROTECT\(return new (.+)\) \s*return nullptr; ``` with ``` $1PROTECT( $1 out__[0] = new $2 $1 return 0; $1) $1return 1; ``` F. Implemented return status code 1. Replaced ``` ^(\s*)PROTECT\(return (.+)\) ``` with ``` $1PROTECT( $1 out__[0] = $2 $1 return 0; $1) ``` G. Implemented return status code 1. Replaced ``` ^(\s*) return (.+) \s*\) \s*return nullptr; ``` with ``` $1 out__[0] = $2 $1 return 0; $1) $1return 1; ``` H. Restored error handling Handled caml_failwith by search/replace: Replaced: ``` $ ^(\s*) caml_failwith\((.+) ``` with: ``` { $1 myerr = strdup($2 $1 return 1; $1} ``` I. Replaced ``` ^(\s+)PROTECT\( return (.+) \) ``` with ``` $1PROTECT( $1 out__[0] = $2 $1 return 0; $1) ``` J. Manual implement return status code K. Changed return code from -1 to 1 to reduce diff L. Fixed a couple of warnings
Configuration menu - View commit details
-
Copy full SHA for b24c65a - Browse repository at this point
Copy the full SHA b24c65aView commit details -
Restored Julia-specific additions
Also, made CUDA build optional. int at_empty_cache(); int at_no_grad(int flag); int at_sync(); int at_from_blob(tensor *, void *data, int64_t *dims, int ndims, int64_t *strides, int nstrides, int dev);
Configuration menu - View commit details
-
Copy full SHA for ece9654 - Browse repository at this point
Copy the full SHA ece9654View commit details -
Dev. container: Added support for CUDA and CUDNN
Also: * Dev. container: Updated for Torch 1.10.2 * Added /build to .gitignore
Configuration menu - View commit details
-
Copy full SHA for c8f1e9c - Browse repository at this point
Copy the full SHA c8f1e9cView commit details -
Added GitHub Actions workflow for building C Wrapper
Factored out scripts - for re-use in CI and dev. container.
Configuration menu - View commit details
-
Copy full SHA for f799133 - Browse repository at this point
Copy the full SHA f799133View commit details -
Configuration menu - View commit details
-
Copy full SHA for 37c6056 - Browse repository at this point
Copy the full SHA 37c6056View commit details