https://github.com/clab/dynet
Revision d5f183de945d21ac253fbf31d3395185b06d448f authored by Yoav Goldberg on 22 September 2017, 09:55:07 UTC, committed by Hong Wu on 22 September 2017, 09:55:07 UTC
* add to_device support in python

* Device support in Python.
Currently there is no dedicated Device class, and we refer to devices by
their string names. This seem less cumbersome and more 'Pythonic'.
However, if we forsee a case where we would really want Device to be an
object, we may do this now for backward compatibility.

The API is:
- dy.available_devices() returns a list of device names.
- dy.to_device(expression, dev_name) copies an expression across
  devices.
- param_colection.add_parameteres(..., device=name)
- param_colection.add_lookup_parameteres(..., device=name)
- param_colection.parameteres_from_numpy(..., device=name)
- param_colection.lookup_parameteres_from_numpy(..., device=name)

The devices mechanism documentation is in doc-string of "available_devices()"

* python DeviceInfo

* python docs

* Device support in input expressions. Proper python exceptions on invalid device names.

* explicit device kw when passing values to xInput (python)


Former-commit-id: 7c8c2ee5eb9570b15260bcff917c8e76ba450717
1 parent 20be05b
History
Tip revision: d5f183de945d21ac253fbf31d3395185b06d448f authored by Yoav Goldberg on 22 September 2017, 09:55:07 UTC
Python multi device (#916)
Tip revision: d5f183d
File Mode Size
.travis
bench
cmake
contrib
doc
docker
dynet
examples
external
python
tests
third_party
tutorial
.gitignore -rw-r--r-- 613 bytes
.gitmodules -rw-r--r-- 124 bytes
.travis.yml -rw-r--r-- 2.1 KB
CMakeLists.txt -rw-r--r-- 8.0 KB
LICENSE.txt -rw-r--r-- 11.0 KB
MANIFEST.in -rw-r--r-- 108 bytes
MEM.notes -rw-r--r-- 493 bytes
README.md -rw-r--r-- 5.8 KB
config.h.cmake -rw-r--r-- 218 bytes
setup.cfg -rw-r--r-- 40 bytes
setup.py -rw-r--r-- 12.7 KB

README.md

back to top