caffe2/python/task: added __repr__ methods to all task definitions (#15250)
authorTristan Rice <tristanr@fb.com>
Mon, 17 Dec 2018 23:59:45 +0000 (15:59 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 18 Dec 2018 00:02:16 +0000 (16:02 -0800)
commite650a848721a39707dcdde3e36a5ca05f3da0510
tree1eaddf5e7e45a2ef2aceabe58bef805b6c5c0091
parente0b261a35b1483e15c7b81a476851abfdb69602a
caffe2/python/task: added __repr__ methods to all task definitions (#15250)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15250

This adds `__repr__` methods to all of the classes under task.py. This makes the objects much easier to interact with when using them in an interactive manner, such as in a Jupyter notebook.

The default `__repr__` method just returns the object ID which is very unhelpful.

Reviewed By: hanli0612

Differential Revision: D13475758

fbshipit-source-id: 6e1b166ec35163b9776c797b6a2e0d002560cd29
caffe2/python/task.py
caffe2/python/task_test.py [new file with mode: 0644]