https://github.com/smoke-y/athena
Deep learning library
https://github.com/smoke-y/athena
cuda deep-learning deep-learning-library
Last synced: 4 months ago
JSON representation
Deep learning library
- Host: GitHub
- URL: https://github.com/smoke-y/athena
- Owner: smoke-y
- Created: 2025-01-19T07:15:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-13T11:44:24.000Z (over 1 year ago)
- Last Synced: 2025-03-13T12:33:48.515Z (over 1 year ago)
- Topics: cuda, deep-learning, deep-learning-library
- Language: Python
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Athena
Another deep learning library.
We don't construct AST tree tho. Athena compiles to ops directly which can be run on CPU(numpy) or GPU(custom cuda kernels).
```python
from athena import *
PROG.driver = CudaDriver()
'''
Shape Static Tensor
By marking a tensor to be static(sshape=True) in shape, the tensor
is allocated in the beginning on the device and is not freed until the end
'''
x = Tensor(data=None, shape = (1,2), num=3, sshape=True)
v = Tensor(data=[[1,2]])
d = x + v
#compile the above operations
PROG.compile()
#print the ops generated in the forward pass
PROG.printForward()
#print the ops generated in the backward pass
PROG.printBackward()
PROG.forward()
print(d.numpy()) #no need to .detach()
PROG.backward(d) #backward with respect to Tensor d
```
```
AllocTmp: (1, 2), 0
AllocTmp: (1, 2), 0
AllocTmp: (1, 2), 0
Add: ,
Add: ,
Add: ,
[[4. 5.]]
```