Skip to content

Conversation

@heavengate
Copy link
Contributor

@heavengate heavengate commented Aug 16, 2020

PR types

New features

PR changes

APIs

Describe

  • add paddle.io.TensorDataset API

td

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@heavengate heavengate changed the title add TensorDataset. test=develop add TensorDataset Aug 16, 2020
@heavengate heavengate changed the title add TensorDataset add TensorDataset for multiprocess DataLoader Aug 16, 2020
@CLAassistant
Copy link

CLAassistant commented Aug 17, 2020

CLA assistant check
All committers have signed the CLA.

LielinJiang
LielinJiang previously approved these changes Aug 19, 2020
import six
import time
import unittest
import multiprocessing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove un-used importing, multiprocessing, time, ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

assert len(input) == 1
assert len(label) == 1
assert input.shape == [1, 3, 4]
assert label.shape == [1, 1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also can check the input/label type. whether it is equal to input_np/label_np.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

"{}".format('__len__', self.__class__.__name__))


class TensorDataset(Dataset):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can TensorDataset only be used in dygraph? if so, raise error in static mode

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

Copy link
Contributor

@Heeenrrry Heeenrrry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@heavengate heavengate merged commit 84e7be3 into PaddlePaddle:develop Aug 27, 2020
@heavengate heavengate deleted the add_tensor_dataset branch August 27, 2020 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants