[
https://issues.apache.org/jira/browse/SINGA-186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15336210#comment-15336210
]
ASF subversion and git services commented on SINGA-186:
-------------------------------------------------------
Commit 2a582df121d8b3fa45dad1e9c0435bc01bf79bea in incubator-singa's branch
refs/heads/dev from chonho
[ https://git-wip-us.apache.org/repos/asf?p=incubator-singa.git;h=2a582df ]
SINGA-186 Create Python Tensor class
- Add Swig interfaces: singa.i
. core_tensor.i for singa::Tensor
. core_device.i for singa::Device
- Add generate_singa_wrapper.sh to generate wrapper
- Add python script: tensor.py, device.py
- Add an example unittest unittest_python.py in test/python
Notes:
- call copy constructor of singa::Tensor in __init__
- rename transpose -> is_tranpose(), which calls Tensor.transpose()
rename matrix_transpose -> transpose(), which calls singa::Tensor.T()
- Revised a way to generate Tensor copy in python
. add copy() for shallow copy, which calls singa::Tensor(Tensor&)
. add deepcopy() for deep copy, which calls singa::Tensor::Clone()
Note: revised __init__()
now clone() and deepcopy() are the same
TODO:
- need think about more efficient way to convert Tensor data to numpy array
- example test is in test/python/example_test_device.py, which will be included
in unittest_python.py
> Create Python Tensor class
> --------------------------
>
> Key: SINGA-186
> URL: https://issues.apache.org/jira/browse/SINGA-186
> Project: Singa
> Issue Type: New Feature
> Reporter: wangwei
>
> This ticket would add a Python Tensor class, which provides functions as the
> C++ Tensor class with APIs in Python convention. Most of these functions are
> implemented by calling the C++ Tensor functions via Swig.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)