Skip to content

Conversation

naoyam
Copy link
Collaborator

@naoyam naoyam commented Nov 19, 2022

Follow-up to #2197 and #2198

Removed Float.

Double, Int and Bool use Scalar template class.

Everything uses template class Scalar
@naoyam naoyam requested a review from zasdfgbnm November 19, 2022 01:02
Comment on lines +67 to +68
using Double = Scalar<double>;
using Int = Scalar<int64_t>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a bit confusing. Should we change the name to FloatingPoint and Integer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm fine with the names, just didn't want to change the existing names. I'd prefer shorter nameas and keep Int as is and rename Double to Float. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That sounds good to me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, Float seems a little off to me as the default underlying type is double, Double seems more intuitive. Let's keep the names as is.

@zasdfgbnm
Copy link
Collaborator

The only blocking comment is #2203 (comment), otherwise LGTM

Copy link
Collaborator

@zasdfgbnm zasdfgbnm left a comment

Choose a reason for hiding this comment

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

Thanks for refactoring! I am wondering if I should start using Scalar to replace Attribute in exprs when applicable. It makes more sense to store a Bool* instead of a Attribute<bool>*

@naoyam
Copy link
Collaborator Author

naoyam commented Nov 19, 2022

Thanks for refactoring! I am wondering if I should start using Scalar to replace Attribute in exprs when applicable. It makes more sense to store a Bool* instead of a Attribute<bool>*

Yeah, I don't know if that would have any immediate benefit, but I guess it would make IR serialization a little easier.

@naoyam naoyam merged commit 1557d69 into devel Nov 19, 2022
@naoyam naoyam deleted the scalar_refactor branch November 19, 2022 02:24
@naoyam naoyam mentioned this pull request Nov 21, 2022
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.

2 participants