Skip to content
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

Shortcut casting causes errors #10

Closed
marcsous opened this issue Apr 30, 2016 · 1 comment
Closed

Shortcut casting causes errors #10

marcsous opened this issue Apr 30, 2016 · 1 comment
Assignees

Comments

@marcsous
Copy link
Contributor

marcsous commented Apr 30, 2016

It looks like the strClass way of casting added here causes problems if the scaling factor is not 1. The order of the operations is scale then cast with the MappedTensor, even if they were applied in a different order, which creates inconsistencies.

Example:

>> a=MappedTensor(1);
>> a(1)=1.5;
>> a=2*uint8(a);
>> a(1)
ans =
    3
>> a=1.5;
>> a=2*uint8(a);
>> a(1)
ans =
    4

I really like the shortcut way of doing things but it would need to track the order of the operations if there are more than 1 of them, as discussed a little bit here.

Probably best to revert this change in the meantime - sorry for the lack of insight when requesting it!

@DylanMuir DylanMuir self-assigned this Apr 30, 2016
@DylanMuir
Copy link
Owner

Fixed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants