Skip to content

Refactor requantization methods #75

@Cesar199999

Description

@Cesar199999

@Antonio95 and I noticed that several functions in the quantization module share a lot of code. We came up with a couple issues that could be fixed in order to reduce the amount of repeated code:

  • The requantize_fc_ntafz and requantize_fc_nte functions are almost identical. The only difference between them is the rounding method used.

  • The following piece of code is repeated in almost all functions:

partial_ord_clamp(x, ST::MIN.into(), ST::MAX.into())
    .try_into()
    .map_err(|_| "Unable to convert Large Type to Small Type")
    .unwrap()

Once dimitris/requantize-bmm-ref is merged, we can start working on these issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions