forked from facebookarchive/iTorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitorch
executable file
·31 lines (31 loc) · 863 Bytes
/
itorch
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
#!/usr/bin/env sh
mode=$1
if [ -z "$mode" ]; then
mode="console"
else
shift
fi
v=$(ipython --version|cut -f1 -d'.')
if [ $v = 2 ]; then
ipython $mode --profile torch $@
elif [ $v = 3 ]; then
if [ $mode = "console" ]; then
ipython $mode --profile torch $@
else
ipython $mode --MappingKernelManager.default_kernel_name="itorch" $@
fi
elif [ $v = 4 ]; then
if [ $mode = "console" ]; then
jupyter console --kernel=itorch $@
else
ipython $mode --MappingKernelManager.default_kernel_name="itorch" $@
fi
elif [ $v = 5 ]; then
if [ $mode = "console" ]; then
jupyter console --kernel=itorch $@
else
ipython $mode --MappingKernelManager.default_kernel_name="itorch" $@
fi
else
echo "Unsupported ipython version. Only major versions 2.xx, 3.xx, 4.xx or 5.xx (Jupyter) are supported"
fi