-
Notifications
You must be signed in to change notification settings - Fork 814
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
Finish tests for Field class #119
Conversation
I think that would be okay? I can't imagine any situation where someone has data in a string that looks like a float and is asking for a FloatTensor, but doesn't want the data converted from string to float. If it's already of the target datatype, this is a no-op anyway. |
If it's already of the target datatype, this is a no-op anyway.
Is this even possible with the standard data flow? I feel like everything
is converted to string.
…On September 14, 2017 at 12:10:51 PM, jekbradbury ***@***.***) wrote:
I think that would be okay? I can't imagine any situation where someone
has data in a string that looks like a float and is asking for a
FloatTensor, but doesn't want the data converted from string to float. If
it's already of the target datatype, this is a no-op anyway.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#119 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AG72X8eFlJ49_fiPLLXKjPOknoitqd8nks5siXo7gaJpZM4PVqTv>
.
|
If you write a custom Dataset that e.g. loads from HDF5, maybe? |
"Please raise an issue at " | ||
"https://github.com/pytorch/text/issues".format(self.tensor_type)) | ||
numericalization_func = self.tensor_types[self.tensor_type] | ||
# It doesn't make sense to explictly coerce to a numeric type if |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Also: - Add a dataset for testing numeric features (float and int) - Coerce non-sequential data with use_vocab=False to numeric types
This PR is a continuation of #47 and finishes testing the various functions for the field class (
build_vocab
andnumericalize
).I also wanted to fix #78 and add a test for it, but I'm unsure how to properly do this. One way would be to simply convert the numerical features to python ints dictated by the input
tensor_type
member (e.g.int
forLongTensor
,float
forFloatTensor
, etc). This feels pretty brittle, does anyone else have any other suggestions?