-
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
[Typing][B-92] Add type annotations for python/paddle/batch.py
#66295
Changes from 1 commit
13af28b
608ec36
0ad3ad8
f9d75f6
cf33d99
ad4bd65
ddb0762
a0aaf82
e266436
9ed6afc
24d594c
2f6d562
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,10 +12,19 @@ | |||||||||
# See the License for the specific language governing permissions and | ||||||||||
# limitations under the License. | ||||||||||
|
||||||||||
__all__ = [] | ||||||||||
from __future__ import annotations | ||||||||||
|
||||||||||
from typing import TYPE_CHECKING, Generator, List, TypeVar | ||||||||||
|
||||||||||
if TYPE_CHECKING: | ||||||||||
from types import ModuleType | ||||||||||
|
||||||||||
T = TypeVar('T') | ||||||||||
Caogration marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
__all__ = [] | ||||||||||
|
||||||||||
def batch(reader, batch_size, drop_last=False): | ||||||||||
def batch( | ||||||||||
reader: Generator[T, None, None], batch_size: int, drop_last: bool = False | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 上面定义了 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||||||
) -> Generator[List[T], None, None]: | ||||||||||
Caogration marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||||||||||
""" | ||||||||||
This operator creates a batched reader which combines the data from the | ||||||||||
input reader to batched data. | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是干啥用的?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是没有用的,在新的提交中已经将其删除。