-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/check input types #673
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Add input mapping decorator. * Add AcceptInput class. * Add SameOutputDim class. * Add SameSeqType class. * Add OutputType class.
* Also add CompositeChecker which could combine many checkers. * Add default_seq_type_and_size
reyoung
force-pushed
the
feature/check_input_types
branch
from
December 1, 2016 03:07
85607ca
to
f1ce10b
Compare
Close due to discussed to add type definitions in Layer by @emailweixu |
zhhsplendid
pushed a commit
to zhhsplendid/Paddle
that referenced
this pull request
Sep 25, 2019
zhhsplendid
pushed a commit
to zhhsplendid/Paddle
that referenced
this pull request
Sep 25, 2019
* synchronize with develop (PaddlePaddle#642) * update_commitid1.3 (PaddlePaddle#641) * update inference c++ API doc (PaddlePaddle#634) * update inference c++ API doc * fix link * thorough clean for doc (PaddlePaddle#644) * thorough clean * delete_DS_Store * Cherrypick1.3 (PaddlePaddle#652) * thorough clean * delete_DS_Store * [Don't merge now]update_install_doc (PaddlePaddle#643) * update_install_doc * follow_comments * add maxdepth (PaddlePaddle#646) * upload_md (PaddlePaddle#649) * update_version (PaddlePaddle#650) * Translation of 16 new apis (PaddlePaddle#651) * fix_windows * Final update 1.3 (PaddlePaddle#653) * thorough clean * delete_DS_Store * update_1.3 * Deadlink fix (PaddlePaddle#654) * fix_deadlinks * update_docker * Update release_note.rst * Update index_cn.rst * update_Paddle (PaddlePaddle#658) * fix pic (PaddlePaddle#659) * [to 1.3] cn api debug (PaddlePaddle#655) (PaddlePaddle#661) * debug * fix 2 -conv2d * "锚" ==> anchor(s) * Weekly cherrypick0302 (PaddlePaddle#668) * Update programming_guide.md (PaddlePaddle#664) * Update programming_guide.md * Update programming_guide_en.md * Update cn api to 1.3 (PaddlePaddle#663) * Update cn api to 1.3 fluid & layers * Rest to 1.3 * Weeklyupdate 0301 (PaddlePaddle#666) * Tables_rm_op * update_op * update_index * update_book_0302 (PaddlePaddle#667) * fix_format (PaddlePaddle#669) (PaddlePaddle#670) * fix_format * Update Tables.md * Update Tables_en.md * add dataset api_cn (PaddlePaddle#673) * rm fluid.core in desigin_idea (PaddlePaddle#674) * Update fluid_design_idea.md * Update fluid_design_idea_en.md * Fix array_read code example error. (PaddlePaddle#671) Signed-off-by: zhaoyuchen <zhaoyuchen01@baidu.com> * add data_reader_cn (PaddlePaddle#676) * fix doc error (PaddlePaddle#675) * update_book_commitid (PaddlePaddle#680) * update_book_commitid * commitid0309 * fix typo * book indexes (PaddlePaddle#677)
yaozhixin
pushed a commit
to graphcore/Paddle-fork
that referenced
this pull request
Apr 28, 2022
…-ipu_607c07ebeff2c055fde72b594ed009c41b14c06d [AUTO PR] Pulling [develop] into [develop-ipu] [2022-04-27 11:51:41+08:00]
wwbitejotunn
pushed a commit
to wwbitejotunn/Paddle
that referenced
this pull request
Jun 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
框架性质的实现了 #341 。只是实现了 data、fc、trans、selective fc几个layer的check工作。
这个事情我又重新思考了一下,感觉在CPP里面实现这个功能可能还是比较慢,鉴于我们最近事情比较多,所以我们还是在Python中把这个事情搞一下吧。
在Python中实现这个事情的缺点就是,需要用户在data_layer里面修改一下设置
size
的方式,从原来直接设置size=
,改成设置input_type=
,进而可以获得到data_layer的数据类型。从而可以让后续的层获得正确的数据类型,这样我们就可以依次检查每个Layer的输入格式了。
对于每个Layer输入格式的检查,使用了python的
decorator
和类似于调用链的方式。decorator是因为,每个Layer可以接受什么类型的输入,产生什么类型的输出,是每一个Layer的属性。使用decorator给Layer做出标注,语意更清晰。使用调用链模式,是因为,每个Layer可以接受的输入和产生的输出不一样,使用调用链可以有效的组合各种情况,在定义各种Layer的输入和输出的时候,会减少代码量。