-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
fix CIFAR MNIST UCIHousing dataset. test=develop #27368
Conversation
Thanks for your contribution! |
@@ -103,7 +103,8 @@ def _load_data(self, feature_num=14, ratio=0.8): | |||
|
|||
def __getitem__(self, idx): | |||
data = self.data[idx] | |||
return np.array(data[:-1]), np.array(data[-1:]) | |||
return np.array(data[:-1]).astype('float32'), \ | |||
np.array(data[-1:]).astype('float32') |
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.
这个建议使用 paddle.get_default_dtype() 来获取默认转换的数据dtype,这样用户在使用set_default_dtype调整了默认dtype后也会保证使用体验一致。
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.
Done, thanks!
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.
LGTM
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.
LGTM
PR types
Bug fixes
PR changes
APIs
Describe
chw_format
ofpaddle.vision.datasets.MNIST
paddle.vision.datasets.MNIST
paddle.vision.datasets.CIFAR10
paddle.vision.datasets.CIFAR100
output image in [C, H, W] formatpaddle.vision.datasets.MNIST
paddle.text.datasets.UCIHousing
return numpy ndarray with dtype asfloat32