-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtorch.nimble
96 lines (87 loc) · 5.75 KB
/
torch.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Package
version = "0.2.3"
author = "Giovanni Petrantoni"
description = "A nim flavor of pytorch"
license = "MIT"
skipDirs = @["docker", "media", "conda", "bin", "scripts"]
skipFiles = @[".gitlab-ci.yml", ".travis.yml"]
# Deps
requires "nim >= 0.19.2"
requires "fragments >= 0.1.27"
task test, "Run cpu tests":
exec """nim cpp -r -o:test torch/generator.nim"""
exec """nim cpp --define:useRealtimeGC -r -o:test torch"""
exec """nim cpp --define:useRealtimeGC -d:release -r -o:test torch"""
exec """nim cpp --define:useRealtimeGC -r -o:test torch/nn/modules.nim"""
exec """nim cpp --define:useRealtimeGC -d:release -r -o:test torch/nn/modules.nim"""
exec """nim cpp --define:useRealtimeGC -r -o:test torch/nn/init.nim"""
exec """nim cpp --define:useRealtimeGC -d:release -r -o:test torch/nn/init.nim"""
exec """nim cpp --define:useRealtimeGC -r -o:test torch/nn/functional.nim"""
exec """nim cpp --define:useRealtimeGC -d:release -r -o:test torch/nn/functional.nim"""
exec """nim cpp --define:useRealtimeGC -r -o:test tests/test_autograd.nim"""
exec """nim cpp --define:useRealtimeGC -d:release -r -o:test tests/test_autograd.nim"""
exec """nim cpp --define:useRealtimeGC -r -o:test tests/test_xor.nim"""
exec """nim cpp --define:useRealtimeGC -d:release -r -o:test tests/test_xor.nim"""
task test_wasm, "Run wasm tests":
exec """nim cpp -r -o:test torch/generator.nim"""
exec """nim torch -d:release -d:wasm -o:test.js torch && node test.js"""
exec """nim torch -d:release -d:wasm -o:test.js torch/nn/modules.nim && node test.js"""
exec """nim torch -d:release -d:wasm -o:test.js torch/nn/init.nim && node test.js"""
exec """nim torch -d:release -d:wasm -o:test.js torch/nn/functional.nim && node test.js"""
exec """nim torch -d:release -d:wasm -o:test.js tests/test_autograd.nim && node test.js"""
exec """nim torch -d:release -d:wasm -o:test.js tests/test_xor.nim && node test.js"""
task test_cuda, "Run cuda gpu tests":
exec """nim cpp -r -o:test torch/generator.nim"""
exec """nim cpp -r -o:test -d:cuda torch"""
exec """nim cpp -d:release -r -o:test -d:cuda torch"""
exec """nim cpp -r -o:test -d:cuda torch/nn/modules.nim"""
exec """nim cpp -d:release -r -o:test -d:cuda torch/nn/modules.nim"""
exec """nim cpp -r -o:test -d:cuda torch/nn/init.nim"""
exec """nim cpp -d:release -r -o:test -d:cuda torch/nn/init.nim"""
exec """nim cpp -r -o:test -d:cuda torch/nn/functional.nim"""
exec """nim cpp -d:release -r -o:test -d:cuda torch/nn/functional.nim"""
exec """nim cpp -r -o:test -d:cuda tests/test_autograd.nim"""
exec """nim cpp -d:release -r -o:test -d:cuda tests/test_autograd.nim"""
exec """nim cpp -r -o:test -d:cuda tests/test_xor.nim"""
exec """nim cpp -d:release -r -o:test -d:cuda tests/test_xor.nim"""
task test_clang, "Run clang tests":
exec """nim cpp -r -o:test torch/generator.nim"""
exec """nim cpp --define:useRealtimeGC --cc:clang -r -o:test torch"""
exec """nim cpp --define:useRealtimeGC -d:release --cc:clang -r -o:test torch"""
exec """nim cpp --define:useRealtimeGC --cc:clang -r -o:test torch/nn/modules.nim"""
exec """nim cpp --define:useRealtimeGC -d:release --cc:clang -r -o:test torch/nn/modules.nim"""
exec """nim cpp --define:useRealtimeGC --cc:clang -r -o:test torch/nn/init.nim"""
exec """nim cpp --define:useRealtimeGC -d:release --cc:clang -r -o:test torch/nn/init.nim"""
exec """nim cpp --define:useRealtimeGC --cc:clang -r -o:test torch/nn/functional.nim"""
exec """nim cpp --define:useRealtimeGC -d:release --cc:clang -r -o:test torch/nn/functional.nim"""
exec """nim cpp --define:useRealtimeGC --cc:clang -r -o:test tests/test_autograd.nim"""
exec """nim cpp --define:useRealtimeGC -d:release --cc:clang -r -o:test tests/test_autograd.nim"""
exec """nim cpp --define:useRealtimeGC --cc:clang -r -o:test tests/test_xor.nim"""
exec """nim cpp --define:useRealtimeGC -d:release --cc:clang -r -o:test tests/test_xor.nim"""
task test_static, "Run clang tests":
exec """nim torch -d:staticlibs -r -o:test torch"""
exec """nim torch -d:staticlibs -d:release -r -o:test torch"""
exec """nim torch -d:staticlibs -r -o:test torch/nn/modules.nim"""
exec """nim torch -d:staticlibs -d:release -r -o:test torch/nn/modules.nim"""
exec """nim torch -d:staticlibs -r -o:test torch/nn/init.nim"""
exec """nim torch -d:staticlibs -d:release -r -o:test torch/nn/init.nim"""
exec """nim torch -d:staticlibs -r -o:test torch/nn/functional.nim"""
exec """nim torch -d:staticlibs -d:release -r -o:test torch/nn/functional.nim"""
exec """nim torch -d:staticlibs -r -o:test tests/test_autograd.nim"""
exec """nim torch -d:staticlibs -d:release -r -o:test tests/test_autograd.nim"""
exec """nim torch -d:staticlibs -r -o:test tests/test_xor.nim"""
exec """nim torch -d:staticlibs -d:release -r -o:test tests/test_xor.nim"""
task test_clang_cuda, "Run clang cuda gpu tests":
exec """nim cpp -r -o:test torch/generator.nim"""
exec """nim cpp --cc:clang -r -o:test -d:cuda torch"""
exec """nim cpp -d:release --cc:clang -r -o:test -d:cuda torch"""
exec """nim cpp --cc:clang -r -o:test -d:cuda torch/nn/modules.nim"""
exec """nim cpp -d:release --cc:clang -r -o:test -d:cuda torch/nn/modules.nim"""
exec """nim cpp --cc:clang -r -o:test -d:cuda torch/nn/init.nim"""
exec """nim cpp -d:release --cc:clang -r -o:test -d:cuda torch/nn/init.nim"""
exec """nim cpp --cc:clang -r -o:test -d:cuda torch/nn/functional.nim"""
exec """nim cpp -d:release --cc:clang -r -o:test -d:cuda torch/nn/functional.nim"""
exec """nim cpp --cc:clang -r -o:test -d:cuda tests/test_autograd.nim"""
exec """nim cpp -d:release --cc:clang -r -o:test -d:cuda tests/test_autograd.nim"""
exec """nim cpp --cc:clang -r -o:test -d:cuda tests/test_xor.nim"""
exec """nim cpp -d:release --cc:clang -r -o:test -d:cuda tests/test_xor.nim"""