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

refactor: fixed point representation to use native signed integers #635

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zintarh
Copy link

@zintarh zintarh commented Apr 30, 2024

Pull Request type

This PR address fixed point representation to use native signed integers for FP16x16

  • Refactoring (no functional changes, no API changes)

Issue Number: #633

Does this introduce a breaking change?

  • No

Copy link
Collaborator

@raphaelDkhn raphaelDkhn left a comment

Choose a reason for hiding this comment

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

Hi, several things are missing here:

  • I left comments in your code
  • fp16 is not recognized by the compiler. Please have a look at the module cheat sheet.
  • The reimplementation of functions for fp16 needs to have tests

}

fn HALF() -> i32 {
HALF
Copy link
Collaborator

Choose a reason for hiding this comment

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

HALF constant is type u32 but the returned type is i32. you should change constant type

}

fn ONE() -> i32 {
ONE
Copy link
Collaborator

Choose a reason for hiding this comment

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

ONE constant is type u32 but the returned type is i32. you should change constant type

}

fn MAX() -> i32 {
MAX
Copy link
Collaborator

Choose a reason for hiding this comment

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

MAX constant is type u32 but the returned type is i32. you should change constant type

Copy link
Author

@zintarh zintarh May 2, 2024

Choose a reason for hiding this comment

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

Alright. I'll look at all these


use orion::numbers::fixed_point::core::FixedTrait;
use orion::numbers::fixed_point::implementations::fp16x16::math::{
core as core_math, trig, hyp, erf
Copy link
Collaborator

Choose a reason for hiding this comment

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

these modules have functions implemented for FP16x16. Not the fp16 implementation. All the functions in that modules needs to be re-implemented for fp16 as well, otherwise you cannot import them in the fp16Impl

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