dongzhihong
572133400d
"update the compute kernel"
8 years ago
dongzhihong
f5636dab80
design doc
8 years ago
Yu Yang
0973c2c97b
Merge pull request #3092 from reyoung/feature/unittest_for_inputs
...
Add PADDLE_ENFORCE for Out Of Range in `OperatorBase`'s `Input`/`Output`
8 years ago
fengjiayi
213fdad1e8
adjust format
8 years ago
qijun
303fb789a5
refine tensor copy from
8 years ago
Yu Yang
48812cd10b
Merge branch 'feature/backward' of github.com:reyoung/Paddle into feature/backward
8 years ago
Yu Yang
42e2fa57bd
Fix unittest
8 years ago
fengjiayi
2198963a41
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into feature/backward
8 years ago
fengjiayi
a2e2cd776d
Fix bug of TEST Backwar.linear_net_intermediate_variable_has_no_grad
8 years ago
qijun
5364b3944e
use cuda default stream
8 years ago
Yu Yang
be528683f6
Fix net_input_of_network_not_need_grad
8 years ago
fengjiayi
39cd39e0e1
Update test
8 years ago
fengjiayi
dc06eaa0b7
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into feature/backward
8 years ago
fengjiayi
1de465b54d
Change some `ASSERT_EQ` to `EXPECT_EQ`
8 years ago
dongzhihong
302046aa51
"fix return net error"
8 years ago
fengjiayi
1197420598
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into feature/backward
8 years ago
fengjiayi
0e337bec25
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into feature/backward
8 years ago
dongzhihong
52054af714
"fix typo"
8 years ago
dongzhihong
0da5cce24f
"fix test case"
8 years ago
fengjiayi
71bd439b45
Addjust Backward.linear_net_intermediate_variable_has_no_grad
8 years ago
dongzhihong
e1cd719a84
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into backward
8 years ago
Yu Yang
d6e0368285
Add comment in backward.cc
8 years ago
dongzhihong
658588a675
"format test case"
8 years ago
dongzhihong
b2e1c48ef5
Merge remote-tracking branch 'reyoung/feature/backward' into feature/backward
8 years ago
dongzhihong
7087a04318
"add unittest"
8 years ago
dongzhihong
74cd9a7542
"fix unittest"
8 years ago
Yu Yang
29d50ad910
Refine unit-test
8 years ago
dongzhihong
72839a768f
fix conflict6
8 years ago
Yu Yang
d0b25ac9b8
Fix some unittest error
8 years ago
Yu Yang
8bf0ca0fab
Fix unittest error
8 years ago
Yu Yang
e1d106752d
Merge branch 'feature/backward' of github.com:reyoung/Paddle into feature/backward
8 years ago
Yu Yang
46d766e238
Merge branch 'feature/unittest_for_inputs' into feature/backward
8 years ago
Yu Yang
8e7c3253f8
Add Some Checker in Input/Output
8 years ago
liaogang
9e523ef649
FIX: order matter in Linux !
8 years ago
dongzhihong
65d2678720
"add simple net test"
8 years ago
liaogang
2631077cdf
Check Insufficient Alloc in tensor
8 years ago
Yu Yang
9b9449fb74
Typo
8 years ago
Yu Yang
b0505fdad1
Merge branch 'develop' into feature/unittest_for_inputs
8 years ago
Yu Yang
5f70e14a5c
Memory error
8 years ago
dongzhihong
404cc056b8
"reverse travesal"
8 years ago
dongzhihong
7088654a27
"add duplicate"
8 years ago
dongzhihong
a0669ead24
Merge remote-tracking branch 'reyoung/feature/backward' into feature/backward
8 years ago
Yu Yang
d4ab70a7e5
Merge branch 'feature/backward' of github.com:reyoung/Paddle into feature/backward
8 years ago
dongzhihong
5713266fb2
Merge remote-tracking branch 'reyoung/feature/backward' into feature/backward
8 years ago
dongzhihong
b9f2bb3747
"wait add generic"
8 years ago
Yu Yang
d2583bd411
InsertOp for NetOp
8 years ago
fengjiayi
b1d8419490
rename test
8 years ago
fengjiayi
4461f3ca4c
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into feature/backward
8 years ago
Yu Yang
84198f7548
Add unittest
8 years ago
fengjiayi
3dd5fd047b
Add unitest of Backward.intermediate_variable_not_need_in_linear_net
8 years ago
Yu Yang
099bb53bc2
Merge branch 'feature/backward' of github.com:reyoung/Paddle into feature/backward
8 years ago
Yu Yang
28c0281d9e
Stash
8 years ago
fengjiayi
04db4183e9
Add unitest of Backward.part_of_input_are_not_need
8 years ago
QI JUN
f96e2157a9
Merge pull request #3059 from QiJune/fix_bug_register_OpKernel
...
fix bug in OpKernel register macro
8 years ago
Yu Yang
63636d69e6
Stash for canpio
8 years ago
Yi Wang
1cfc8b6ebc
Merge pull request #3056 from gangliao/cpu_mem
...
ENH: Refine Tensor and Add CopyFrom
8 years ago
Yu Yang
3d18737b84
Add unittest for part_of_output_are_not_need
8 years ago
Yu Yang
f9fab14c4e
Fix compile error
8 years ago
Yu Yang
9475972bc9
Merge branch 'feature/backward' of github.com:reyoung/Paddle into feature/backward
8 years ago
fengjiayi
5297bcb251
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into feature/backward
8 years ago
fengjiayi
03f418c5d1
Fix compile error
8 years ago
Yu Yang
fa6a46a82a
Merge branch 'feature/backward' of github.com:reyoung/Paddle into feature/backward
8 years ago
Yu Yang
e0463acfc3
Rename PlainNet --> NetOp
8 years ago
Yu Yang
05d9afff1c
Stash
8 years ago
dongzhihong
292f2ab1a5
"split to generic add PR"
8 years ago
dongzhihong
0ac79a38fb
Merge remote-tracking branch 'reyoung/feature/backward' into feature/backward
8 years ago
dongzhihong
fa7cbfdeec
"backward is NetOp"
8 years ago
fengjiayi
f77c63b87a
Merge branch 'feature/backward' of https://github.com/reyoung/Paddle into feature/backward
8 years ago
Yu Yang
831d4e1c85
Refining Unittest
8 years ago
fengjiayi
e32e306821
Develop backward building precess of single op
8 years ago
Yu Yang
00615ebca2
Refine OpRegistry::AddInput/AddOutput
...
Remove bool argument, use a class to handle that.
8 years ago
Yu Yang
b1b13f8f54
Update Interface
8 years ago
liaogang
1c68f119d5
ENH: Add GPU CopyFrom Unit Test
8 years ago
Yu Yang
ecf23ce5f3
Update Backward
8 years ago
Yu Yang
b1b4364580
Rename PlainNet --> NetOp
8 years ago
gangliao
2f6e7a58d3
Merge pull request #3055 from reyoung/feature/unify_enforce_error_to_make_it_catchable
...
Make PADDLE_ENFORCE and PADDLE_THROW catchable
8 years ago
dongzhihong
9a16327b15
"remove const qualify"
8 years ago
dongzhihong
11f9f5fb17
"fix const dependency hell"
8 years ago
qijun
953eaadbf6
fix bug in OpKernelKey equal method
8 years ago
qijun
6a5793baba
fix bug in OpKernel register macro
8 years ago
qijun
4ecf68e0ea
fix bug in register gpu OpKernel
8 years ago
dongzhihong
984225ecf1
"fix operator"
8 years ago
liaogang
4e94cd757c
FIX: restricting c++ template usage to POD types
8 years ago
Yu Yang
afe7bf6179
Merge pull request #3032 from reyoung/feature/middle_level_net_api
...
Feature/middle level net api
8 years ago
Yu Yang
bc09551e8c
Fix unittest
8 years ago
liaogang
de8a8feeb4
ENH: Refine Tensor and And CopyFrom
8 years ago
qijun
a71a9e6393
fix gpu build error
8 years ago
qijun
d5109130f1
set default cpu place for tensor alloc
8 years ago
qijun
e2ba13373a
enable operator gpu unittest
8 years ago
Yu Yang
754f0c68da
Fix unittest
8 years ago
Yu Yang
0467cd2dfe
Merge branch 'develop' into feature/middle_level_net_api
8 years ago
fengjiayi
ae6009dfef
fix compile error
8 years ago
fengjiayi
77af58f8f7
Change gradient Op registry mechanism
...
OLD: op_type -> grad_op_creator
NEW: grad_op_type -> grad_op_creator
op_type -> grad_op_type
8 years ago
fengjiayi
81df39fe2a
fix compile errer
8 years ago
Yu Yang
0ceeacbe45
Make Scope can lookup variable name by variable
...
* Refine unittest also
8 years ago
fengjiayi
f4e25550cd
Fix compile error
...
Replace `OperatorPtr` with `std::shared_ptr<OperatorBase>`
8 years ago
fengjiayi
5f3bc2a44a
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into backward
8 years ago
fengjiayi
380227b58a
Renew CMakeList dependence
8 years ago
fengjiayi
f85ccdd351
Renew CMakeList dependence
8 years ago
Yu Yang
c2543f5b29
Remove ScopePtr and OperatorPtr
...
* ScopePtr means pointer of scope, but it can be shared or uniqued.
Change it to std::shared_ptr<Scope> to make code better to read.
8 years ago
Yu Yang
1294b3c53e
Expose Net to Python ( #2967 )
...
* Expose Net to Python
* Expose PlainNet to Python, make python can add_op, complete_add_op
* Provide a low level api to manipulate Net
* Unittest for Net::DebugString
8 years ago
Yi Wang
045470cf00
Slight simplification of eigen.h in hope to make it more readable.
8 years ago
fengjiayi
da07ec1886
Update Tensor and PODDeleter's template parameter
...
1. Change PODDeleter's template parameter 'PlaceType' to 'Place'.
2. Limit PODDeleter and Tensor::mutable_data()'s `T` to POD type.
8 years ago
fengjiayi
6cd94cc73f
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into dev_refactor_tensor
8 years ago
fengjiayi
4736b239d9
Add a simple test for grad_op_creator
8 years ago
fengjiayi
9418717f80
Fix compile errors
8 years ago
fengjiayi
f41fcd43d0
Merge branch 'backward' of https://github.com/dzhwinter/Paddle into backward
8 years ago
fengjiayi
99a5904c75
Merge branch 'backward_dev' into backward
8 years ago
dongzhihong
088e2200c4
"remove unused fake fc op"
8 years ago
qijun
586365e0ad
using alias to simplify code
8 years ago
qijun
407b0efc79
fix bug in EigenVector::Flatten method
8 years ago
fengjiayi
b635af71d8
Fix some compile error
8 years ago
fengjiayi
8a5ee462a5
Fix some compile errors
8 years ago
dongzhihong
6f0539246c
Merge remote-tracking branch 'origin/develop' into backward2
8 years ago
dongzhihong
81a352aff7
"test fc without gradient"
8 years ago
dongzhihong
14424f314c
"use built-in operator"
8 years ago
fengjiayi
e192d0fd01
Refactor the implementation of gradient Op creating
8 years ago
dongzhihong
4876f35858
"make plainNet shared"
8 years ago
liaogang
5e8a4f16c7
Fix conflcts
8 years ago
liaogang
aae53d836b
Merge conflicts
8 years ago
QI JUN
d81084939b
Merge pull request #2953 from wangkuiyi/tensor_type_to_eigen
...
Refactorize Tensor to Eigen convesion
8 years ago
qijun
d6d057b4e8
change EQ to NEAR for float value
8 years ago
dongzhihong
73f4779808
Merge remote-tracking branch 'origin/develop' into backward2
8 years ago
qijun
57c27b4e00
make EigenTensor default unaligned and follow comments
8 years ago
fengjiayi
55d301722f
Simplify Tensor implimentation
...
ATTENTION: some interfaces changed:
1. void Tensor::set_dims(const DDim& dims) ==> void Tensor::Resize(const DDim& dims).
2. void Tensor::ShareDataFrom(const Tensor& src) ==> void Tensor::ShareDataWith(const Tensor& src)
3. DDim Tensor::dims() const ==> const DDim& Tensor::dims() const
8 years ago
fengjiayi
3dc70ff282
Merge branch 'backward' of https://github.com/dzhwinter/Paddle into backward
8 years ago
Yu Yang
e8304bd92a
Merge pull request #2945 from reyoung/feature/grouped_ops
...
Skeleton Of fully connected operator
8 years ago
dongzhihong
8bc4892106
"fix comment "
8 years ago
qijun
cff8762f26
add more uinttest for EigenTensor
8 years ago
liaogang
941eccac83
Follow comments
8 years ago
fengjiayi
94a6b1fa43
rename a macro
8 years ago
dongzhihong
cb95587feb
"ignore some gradient of specific op"
8 years ago
qijun
d9fa6159b7
add Flatten method to EigenVector
8 years ago
fengjiayi
bf4da3d97a
Refactor Rigistry::CreateGradOp()
...
We put forward Op's inputs, outputs and output gradients into Grad
Op's inputs, and put forward Op's input gradients into Grad Op's output.
So Grad Op's `in_out_idx`, `input_format` and 'output format' need to be
rebuilt during Op creating.
8 years ago
Yu Yang
b90780c3a8
Merge pull request #2939 from reyoung/feature/refine_tensor_hpp
...
Tensor should use PADDLE_ONLY_CPU macro
8 years ago
Yi Wang
1981eaf922
Fix Tensor::data interface
8 years ago
Yi Wang
2538e20787
Fix wrong inclusion path
8 years ago
Yi Wang
00ed564307
Update
8 years ago
Yi Wang
cb1d1f167c
Add unit test
8 years ago
Yi Wang
642d3c4687
Refactorize Tensor to Eigen convesion
8 years ago
fengjiayi
e786746f6f
Merge branch 'backward' of https://github.com/dzhwinter/Paddle into backward
8 years ago
dongzhihong
855cae603c
move unused file
8 years ago
fengjiayi
7f1533f251
test collaborating
8 years ago
dongzhihong
8b80cf8989
"add net op testing"
8 years ago
dongzhihong
9890b23c82
fix confilct
8 years ago
dongzhihong
816b4c8ab0
"add backward Op"
8 years ago
Yu Yang
d3373c5b85
Skeleton Of fully connected operator
...
* Fc operator is a grouped operator, which combined by may internal
operators.
* InferShape & Run a FC operator in Python.
8 years ago
Yu Yang
ad728419d6
Merge pull request #2912 from reyoung/feature/better_network_debug_str
...
Override Net::DebugString to invoke inner ops_
8 years ago
Yu Yang
107b3395b4
Merge branch 'develop' into feature/better_network_debug_str
8 years ago
QI JUN
3208914b56
Merge pull request #2805 from QiJune/tensor_to_EigenTensor
...
Add method converting Tensor to Eigen TensorMap
8 years ago
Yu Yang
fb48cb120d
Merge pull request #2936 from reyoung/feature/create_op_in_cpp_params
...
Make CreateOp in Plain C++ params
8 years ago
Yu Yang
9b964b535b
Tensor should use PADDLE_ONLY_CPU macro
...
* Not use __CUDACC__ macro, because malloc in GPU memory do not have to
used in .cu file.
* Also, `PADDLE_ENFORCE` logic is wrong.
8 years ago
Yu Yang
8539222a1a
Merge branch 'develop' into feature/is_in_gpu
8 years ago
Yu Yang
1dc53a289f
Use friend not to expose tensor's `type/place`
8 years ago
Yu Yang
f6a51d9b4e
Make CreateOp in Plain C++ params
8 years ago
QI JUN
d344f6702c
Merge branch 'develop' into tensor_to_EigenTensor
8 years ago
Yu Yang
c1219a530c
Change `in_out_idxs_` to shared_ptr
...
* `in_out_idxs_` shares between all operator instance in same type
of operator.
8 years ago
Yu Yang
1ac0bffaf7
Override Net::DebugString to invoke inner ops_
...
Net::DebugString() print what it is and invokes inner operators
DebugString() with a prefix '\t'.
8 years ago
Yu Yang
e00aae5386
Fix Merge Bugs
...
* There is a merge conflict when merge PR #2914
* Develop and PR #2914 both add `DDim::size` method, but did not
triger git merge conflict while merge.
8 years ago
Qiao Longfei
051676a7e4
support multiple template parameter in KernelType for REGISTER_OP_XPU_KERNEL ( #2932 )
8 years ago
Yu Yang
861b66d4e3
Merge pull request #2914 from reyoung/feature/add_some_skeletons_of_ops
...
Add skeletons of `mul`, `rowwise_add`, `sigmoid`, `softmax` ops
8 years ago
qijun
4d49f1d892
merge baidu/develop
8 years ago
Yu Yang
bde90be71b
Read/Write a Tensor Python
...
Basically following
http://pybind11.readthedocs.io/en/stable/advanced/pycpp/numpy.html
* Use buffer protocol to return a view of Tensor. It can be cast to
numpy array in Python.
* Set a numpy array to a tensor.
8 years ago
fengjiayi
78fa5e307d
Add DDim::size()
8 years ago
fengjiayi
78bd815e85
refine conditional compilation and remove `numel_`
8 years ago
fengjiayi
1cd14f661b
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into dev_enable_tensor_test
8 years ago
Yu Yang
ad8fa77cce
Merge branch 'develop' into feature/add_some_skeletons_of_ops
8 years ago
Yu Yang
5847b96a61
Follow comments, correct implement `DDim::size()`
...
* Also fix unit test
8 years ago
qijun
87189665d9
merge baidu/develop
8 years ago
qijun
2a03e3808d
set correct place for output tensor
8 years ago
Yu Yang
0e77b31a02
Merge branch 'develop' into feature/op_creation_methods
8 years ago
Yan Chunwei
a0caf23430
Op varient inputs ( #2901 )
...
* add inputs
* add ut for multiple inputs
* fix AddToLayer
* op_desc -> op_proto
* CreateArgumentOffsetMap -> CreateInOutOffsetMap
* move CreateInOutOffsetMap from OperatorBase to op registry
* arg_idxs_ -> in_out_idxs_
8 years ago
Yu Yang
1ed237c11e
Add skeletons of `mul`, `rowwise_add`, `sigmoid`, `softmax` ops
...
* Implement InferShape and register them, give a stub Kernel method
by LOG(INFO)
8 years ago
qijun
6dc567a52e
merge baidu/develop
8 years ago
qijun
5017b15468
refactor tensor mutable_data
8 years ago
Yu Yang
a4eaf2d3ba
Merge pull request #2897 from reyoung/feature/op_library
...
CMake `op_library` function
8 years ago
fengjiayi
a33e9da9c9
Merge pull request #2900 from Canpio/dev_ddim_update
...
Refactor DDim's product() and add slice_ddim()
8 years ago
Yu Yang
38310f9349
Refine CMake dependencies graph
8 years ago
Qiao Longfei
80a26a6308
check duplicate of ProtoAndCheckerMaker ( #2903 )
8 years ago
Yan Chunwei
cdec563449
Add enforce switch for convient develop ( #2850 )
...
* add NDEBUG switch to PADDLE_ENFORCE
8 years ago
Yu Yang
c5bc126762
Follow comment, rename to `GenerateTempVariableName`
8 years ago
Yu Yang
68f6ac011c
Merge branch 'develop' into feature/op_creation_methods
8 years ago
fengjiayi
778a1a9f87
add a comment for
8 years ago
qijun
65dbeb6a24
fix gpu build error
8 years ago
qijun
9e3a9eb233
merge baidu/develop
8 years ago
qijun
d649dbf442
implement add_op kernel
8 years ago
Qiao Longfei
45ce1649a1
change net to operator ( #2846 )
...
* OperatorBase should not store OpDesc because not All op contains an
OpDesc and not all ops create from OpDesc.
* Networks do not contain OpDesc and are not created by OpDesc
* Do not register Network to OpRegistry.
* The network is directly created by the user in Python. Not from
registry.
* Correctly handle the `inputs` and `outputs` of a Network.
* Add CompleteAddOp() methods
* Remove `AddOp(OpDesc&)` in net-op. All op are added by OperatorPtr.
* Rewrite unit test for truly tested what networks do.
* optimise operator_test
8 years ago
fengjiayi
7de10ee7e2
formate code
8 years ago
fengjiayi
85c4f488f3
Refactor DDim's product() and add slice_ddim()
...
1. Refactor DDim's product() to make it more efficiently.
2. Add slice_ddim().
8 years ago
Qiao Longfei
afa99d9ae6
add ADD_OP_CPU to enable add op with only cpu kernel ( #2896 )
...
* add ADD_OP_CPU to enable add op with only cpu kernel
8 years ago
Yu Yang
9e0c6800c5
Python Generate OpCreation Methods by OpProto
...
All OpCreation method are generated by
`create_op_creation_methods::__bootstrap__` method, and stores in
`op_creations` object and its methods.
There are three parts to implement this feature.
1. Get all registered `OpProto` from C++ side. It is implemented in
`get_all_op_protos` method.
1. Create a function to convert `kwargs` to `OpDesc` base on each op's
`OpProto`. The `OpDescCreationMethod` class.
1. Convert `OpProto` to `docstring` by `get_docstring_from_op_proto`
method.
All three methods are unit tested. The `__bootstrap__` just combines
them together and create a method in runtime.
For details, please reference the doc string in
`create_op_creation_methods.py` and the unit test
`test_op_creation_methods.py`.
8 years ago
Yu Yang
1faf5e0313
Merge pull request #2864 from reyoung/feature/op_creation_methods
...
Get OpProtos in Python
8 years ago
fengjiayi
afa2a88d78
add conditional compilation for tensor
8 years ago
fengjiayi
66cf21c880
fix compile error
8 years ago
fengjiayi
68adb9541d
enbale tensor memory test
8 years ago
fengjiayi
ee90c2d22b
add slice_dim draft
8 years ago
liaogang
620575b6eb
FIX: cpplint code style
8 years ago
liaogang
90c4cd8323
FIX: header file
8 years ago
liaogang
f812de2cce
ENH: unify PADDLE_ENFORCE
8 years ago
fengjiayi
c48fc4d826
Merge pull request #2825 from Canpio/dev_add_tensor_copy
...
Add Tensor::CopyFrom and Tensor::mutable_data(Place place)
8 years ago
fengjiayi
57a22db3fa
update PADDLE_ENFORCE message
8 years ago
fengjiayi
34beec0f7a
update tensor.h
8 years ago
fengjiayi
8594d5c314
change int numel_ to size_t numel
8 years ago
fengjiayi
8bcd1faffc
refactor product(DDim ddim)
8 years ago
fengjiayi
1f97388a34
fix several compile error
8 years ago
fengjiayi
dcfcf6872a
Refactor Tensor::CopyFrom()
...
1. Add template T which indicates data type to `CopyFrom()`, `Slice()`
and `ShareData()` functions. This makes `CopyData()` code much clearer.
2. Add `set_dim()`.
3. `product(DDim)` transforms `DDim` to `vector<int>` first and then calculate
its product. That might be quite slow. For `product(dims_)` is frequently
used in Tensor, we add a mumber variable `numel_` as a cache of the
product result.
TODO: refactor `product()` to make it more efficient.
4. Unable Tensor::operator=
5. Remove the limit of POD type, because `float16` and `int8` are not POD type.
8 years ago
fengjiayi
a1dc4311a3
Refactor `Tensor::CopyFrom()`
8 years ago
qijun
bac1426d47
add_op kernel implementation
8 years ago
Qiao Longfei
58f3de95cf
Optimize ptr ( #2851 )
...
* use OperatorPtr = std::shared_ptr<OperatorBase>;
* use ScopePtr = std::share_ptr<Scope>;
8 years ago
Yu Yang
2462d0c5fe
Let OpProto support multiple and temporary ( #2860 )
...
* Let OpProto support multiple and temporary
* Each input/output of Paddle's Op could be a list. Add multiple mark to
OpProto. Also add a `input_format`/`output_format` attribute if that
Op has multiple input or output. The format of that attribute please
reference the comments in `op_proto.proto`
* Add temporary mark, because some output of an Op is not used by user
but used by other op for faster computation. Explicitly mark which
output is temporary could let future memory/computation optimization.
* Add generated field to AttrProto.
* Add `AddInputs`/`AddOutputs` function
* It is more readable to invoke `AddInputs` not
`AddInput(multiple=true)`.
8 years ago
Yu Yang
cd5113c197
Init commit
8 years ago
qijun
0b0b3ba16a
Merge remote-tracking branch 'baidu/develop' into tensor_to_EigenTensor
8 years ago
fengjiayi
dfa4650920
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into dev_add_tensor_copy
8 years ago
Yu Yang
79b70c2d69
Follow comments
...
* Convert `op` --> `operators`
* Remove AddType in OpProtoMaker, because type is part of registry.
* Rename CPU_OR_GPU --> DEVICE_TYPE in registry macro.
8 years ago
Yu Yang
a0aaafe9de
Add a sample op, `add_op`
...
* Refine register methods, make Op can get rid of whole-archieve
* `USE_OP` before a op is used.
* Add unittest for add_op.
8 years ago
qijun
f6fe37155f
Merge remote-tracking branch 'baidu/develop' into fix_bug_dynload
8 years ago
Qiao Longfei
728665d709
Add Init to OperatorBase ( #2838 )
8 years ago
qijun
71e2a94310
Merge remote-tracking branch 'baidu/develop' into tensor_to_EigenTensor
8 years ago
qijun
4e918377d0
fix bug in dynload
8 years ago
Qiao Longfei
be441f7d16
test OpKernel ( #2820 )
...
Add unit test for OpKernel
8 years ago
fengjiayi
69d99d481d
Add Tensor::CopyFrom and Tensor::mutable_data(Place place)
...
1. Add `Tensor::CopyFrom`. Current version can only support CPU memory
copy. The support of GPU will be provided later by `paddle::memory`.
The current implementation of `Tensor::CopyFrom` is a little inefficient:
Every time `CopyFrom` is called, tensor will re-allocate its memory. However, if
we try to check and reuse `placeholder_`, we have to provide a template
parameter for `CopyFrom` to indicate the data type. It seems strange for
a simple copy function.
2. Add `Tensor::mutable_data(Place place)`, which directly use member
variable `dims_` as its dim parameter. This interface is required by
`Op::InferShape`.
8 years ago
Yu Yang
0a32008126
Merge pull request #2815 from reyoung/feature/op_kernel
...
OperatorWithKernel
8 years ago
Yu Yang
0ff8192072
Add OperatorWithKernel class
...
* User can register OpKernel to its Ops. The OpKernelMap saved in
OperatorWithKernel. Each Op which inherits OperatorWithKernel will
use `OpKernel::Compute` instead of Run.
8 years ago
qijun
37bcc0860a
merge baidu/develop
8 years ago
fengjiayi
8681c5800b
Merge pull request #2813 from Canpio/dev_update_dim
...
Remove Dim::contiguous and Dim::contiguous_strides
8 years ago
fengjiayi
76b4dd6226
Merge pull request #2809 from Canpio/dev_add_tensor_interface
...
add tensor interfaces
8 years ago
fengjiayi
2dbe60e489
Remove Dim::contiguous and Dim::contiguous_strides
...
Paddle's data block is row-major order, while Dim::contiguous and
Dim::contiguous_strides are based on column-order. So remove them to
prevent misuse.
8 years ago
fengjiayi
2dccab87d4
fix some syntax problems
8 years ago
Qiao Longfei
a2e5f652d3
add operator base ( #2725 )
...
Add OperatorBase.
issue: https://github.com/PaddlePaddle/Paddle/issues/2790
Paddle design the Operator with Kernel. OperatorBase has no type and device information when create, One operator can have multiple kernels, Operator will choose a kernel to run according to context. The kernel should be bind to Operator before or during Operator running.
8 years ago
fengjiayi
0665dc9755
add more test
8 years ago
fengjiayi
ca39515e24
Add several interfaces for Tensor class
...
1. Add member variable 'DDim dims_' and a getter function 'dims()'.
'dims' is supposed to hold tensor's shape during Op::InferShape.
2. Remove 'mutable_data' which use default Place. User must specify a
explicit Place when call 'mutable_data'.
3. A PlaceHolder may be shared by more than one tensor, and some of them may be the others' slices. So we add a new member variable 'offset_' for Tensor, which is used to show the byte offset between PlaceHolder::ptr_ and where tensor's data really begins.
4. Add functions 'ShareDataFrom' and 'Slice' for Tensor.
TODO: Tensor needs a 'CopyFrom' function.
8 years ago
Yu Yang
267f9a2cdf
Move static variable defined in .cc ( #2782 )
...
* Move static variable defined in .cc
We cannot define static variable in .h, because it will be multi-defined
errors.
Also fix some cpp syntax, like:
* Prefer to use algorithm not manually for-loop, to make code more
readable.
* Remove unused `()`.
* Enforce take a bool. It is no need `xxx==true`.
* Use range-based for-loop iterator from op_desc.attrs
* Fix a protential static variable init order error
8 years ago
qijun
a5eb1d8fab
fix build error
8 years ago
qijun
d607f0b703
use cached rank
8 years ago
Yu Yang
abff52abcb
Simplelize framework/CMakeLists.txt ( #2803 )
...
* generic.cmake can propogate dependencies through libraries. It is no
need to specific all dependencies.
8 years ago
qijun
958511160b
add simple add_op_functor
8 years ago
qijun
d6f7c3535d
move unaligned tensor types
8 years ago
dongzhihong
b871641a53
"switch to shared_ptr"
8 years ago
dongzhihong
18e65b0c08
"support net_proto header"
8 years ago
dongzhihong
bc021d775e
"move opContext to DeviceContext"
8 years ago
qijun
1a968b4f64
init
8 years ago
dongzhihong
052d1d16ee
Merge remote-tracking branch 'origin/develop' into net_ycw
8 years ago
fengjiayi
1d2ef1db82
[draft] add registry for Op, OpProto and OpAttrChecker ( #2739 )
...
* init op_registry.h
* dev op_registry.h
* add 'attr_checker.h', which is a draft of op attribute checker.
* rename some macro parameters
* 1. Use `Attribute` and `AttributeMap` instead of `OpDesc`. `AttributeMap` is a unordered_map of <string, Attribute>, and `Attribute` is a boost::variant object to hold multiple types of attribute value.
2. Use `PADDLE_ENFORCE` to print checkers' fail message.
3. Abstract default value operations to a new function: `DefaultChecker`.
* rename DefaultChecker to DefaultValueSetter
ZZ
* Finish op_registry
1. Complete the development of interfaces between OpRegistry and
Protobuf.
2. Add unit test for op_registry.h
* Add demo and test of custome checker
* fix merge conflict
8 years ago
Yu Yang
e2ea1f42e9
Generate python protobufs for paddle.v2.framework
...
Python should be able to manipulate Protobuf message because:
1. Python's `create_op_creation_methods` take the `OpProto` array to
generate all `op_creation_methods` in RunTime.
2. All `op_creation_methods` will create an `OpDesc` and pass it to
Paddle C++ method `CreateOp` and return the Op handle.
Here is the list of what is added in this commit:
* Add `protobuf_generate_python` if it is not defined.
* Before cmake 3.4, `protobuf_generate_python` is not defined. Just
copy the implementation of that function in `protobuf.cmake`
* Add `py_proto_compile` function in `cmake/generic.cmake`.
* It follows bazel's API interface.
* https://github.com/pubref/rules_protobuf#rules
* Add an empty package named `paddle.v2.framework`, all python code of
`paddle::framework` will be in that package.
* Generate protobuf's python module `__init__.py` by `touch` while
compiling.
* Change setup.py.in, make `paddle.v2.framework.proto` uses the
generated protobuf pythons.
8 years ago
Superjom
1264480b04
fix ci
8 years ago
Superjom
5cf9a23f9b
Merge branch 'develop' of github.com:PaddlePaddle/Paddle into network
8 years ago
Superjom
568c03ba1d
add virtual implementation
8 years ago
fengjiayi
830877f59b
Merge pull request #2706 from Canpio/dev_tensor_test
...
fix compile errors in tensor.
`PlaceholderImpl::Deleter` maybe used in other modules. We can consider moving it to be `paddle::memory::Deleter`.
8 years ago
Superjom
5c10a5ad55
remove virtual
8 years ago
Superjom
9f2357561d
fix ci error
8 years ago
Superjom
d1945e8d56
Merge branch 'develop' of github.com:PaddlePaddle/Paddle into network
8 years ago
Qiao Longfei
571714159a
add op_desc.proto ( #2736 )
...
* add op_desc.proto
In Operator design, we need a proto message to describe an Operator.
Third-party language such as python can build this proto message and use
AddOp(const OpDesc& op_desc) of Paddle core to construct an Op in the
Network.
8 years ago
Superjom
e95299b583
fix ci error
8 years ago
Superjom
109937b8d5
fix ci error
8 years ago
Superjom (Chunwei Yan)
58b7d9a048
Merge branch 'develop' into network
8 years ago
Superjom
16a1637ffe
Merge branch 'develop' of github.com:PaddlePaddle/Paddle into network
8 years ago
Yu Yang
b7397031e9
Add target_link_libraries for cc_library
...
It will fix #2728 .
Maybe it is silly to `target_link_libraries` for static library,
because a static library do not need to link other libraries. But
it will tell cmake how to propagate dependencies.
The solution comes from
[here](http://floooh.github.io/2016/01/12/cmake-dependency-juggling.html ).
* Also change op_proto_test DEPS for testing this fix works.
8 years ago
Superjom
04e20034df
replace Error with void
8 years ago
Superjom
c602e04613
add fake interfaces to make compilable
8 years ago
Yu Yang
9558770f26
Merge pull request #2731 from reyoung/feature/add_deps_for_generic_protobuf
...
Add DEPS to `proto_library`
8 years ago
Superjom
90f55b1b18
Merge branch 'develop' of github.com:PaddlePaddle/Paddle into network
8 years ago
Yu Yang
3de3894b82
Add DEPS to `proto_library`
...
Missing DEPS will cause compile error when parallel is large.
8 years ago
Superjom (Chunwei Yan)
06156daa28
net design with NetBuilder ( #2598 )
...
* move net_design to framework
* change CreateNet result to unique_ptr
* rename "ScratchNet" -> "PlainNet"
* add three methods to NetBase
* add NetBuilder
* add InferShape to NetBuilder.Run
* rename ApplyGradient, ApplyOptimizer -> AddGradientOps, AddOptimiz
* rename PlainNet::CreateNet -> BuildNet
* add Error and other rename actions
8 years ago
dongzhihong
9f365d3636
"add net proto"
8 years ago
dongzhihong
aadbd49814
Merge remote-tracking branch 'origin/develop' into network
8 years ago
Yu Yang
80f8e24209
Merge pull request #2703 from reyoung/feature/op_proto
...
Add OpProto implementation
8 years ago
Yu Yang
3f63d96abe
Fix link error in op_proto_test.
8 years ago
fengjiayi
e48e21da2b
remove unnecessary include
8 years ago
fengjiayi
2d1f95de87
fix a compile error
8 years ago
fengjiayi
d054a5eef8
re-submit
8 years ago
fengjiayi
e146fe836b
fix compile errors and add assert test
8 years ago
Yu Yang
9bf9816828
Add OpProto unittest.
8 years ago
Yu Yang
bdd2720877
Add OpProto implementation
...
OpProto is a proto message that helps 3rd-party language bindings, e.g.
`Python`, to generate operator creation methods. The operator creation
method is the low-level API for 3rd-party language bindings. Op creation
methods take the user's input in that language, and convert users inputs
into `OpDesc` message, then passing that `OpDesc` message to Paddle's
C++ core and create an operator.
* A separated `attr_type.proto` is added, because that file wound
be included by `op_desc.proto` in future.
8 years ago
fengjiayi
9f408dfb1b
fix some compile error
8 years ago
fengjiayi
696ba1d2e1
init tensor_test.cc
8 years ago
Superjom
40573cd56f
add net headers
8 years ago
fengjiayi
bad85f94c3
Merge pull request #2611 from wangkuiyi/tensor
...
Add tensor.h
8 years ago
qiaolongfei
9af54c9ee9
do not use default argument in Scope
8 years ago
qiaolongfei
cfdfa89bdd
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into scope-impl
8 years ago
qiaolongfei
aabe171566
merge CreateVar and GetOrCreateVar
8 years ago
Yu Yang
f0a3fb6e36
Using paddle::string in enforce
8 years ago
qiaolongfei
1678ad7b30
add Create for scope
8 years ago
qiaolongfei
b8ffa8b9e9
move code to scope.h, remove scope.cc
8 years ago
qiaolongfei
3e16f5fdfb
clang format
8 years ago
qiaolongfei
6ad1d21c4b
refine code of operator
8 years ago
Yi Wang
c263c21f7e
Update copyright informaiton
8 years ago
Yi Wang
2c188a20de
Follow QingQing's suggestion
8 years ago
qiaolongfei
7d138593d2
refine code of scope with style check
8 years ago
qiaolongfei
fa4f00d9b5
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into scope-impl
8 years ago
qiaolongfei
5e8d8e073b
refine GetOrCreateVariable
8 years ago
qiaolongfei
2f47562df8
scope-impl
8 years ago
Yu Yang
5b31bd7ae3
Add `Variable::IsType`
...
Make user can check what type is in variable
8 years ago
Yi Wang
e2e0fbd418
Add tesnor.h
8 years ago
Yi Wang
bd4559abbe
Add design doc
8 years ago
Yi Wang
ac28fad6f3
Add type assertion in Variable::Get
8 years ago
Yi Wang
58efbf41b3
Follow comments from Xu Wei
8 years ago
Yi Wang
5a22d73651
Add variable.h and test
8 years ago
Yi Wang
8913aff194
Make paddle/framework buildable and passed
8 years ago
Yi Wang
d03159be09
Use Google Style in new directories
8 years ago
Yi Wang
bb88202879
Move paddle/majel/* to paddle/platform/ and paddle/framework/
8 years ago