burn icon indicating copy to clipboard operation
burn copied to clipboard

Move more repeated functions and traits into `burn-common` crate

Open Luni-4 opened this issue 2 years ago • 2 comments

Feature description

The burn-common crate should contain all those functions and traits which are repedetely used within all the other burn crates. These functions can be used for tests and benchmarks contexts as well,

Feature motivation

To reduce boilerplates and avoid repetitions in the code. In addition, this crate can expose some of these methods and traits as public APIs such that other projects can use them as well.

(Optional) Suggest a Solution

Possible strategy to improve burn-common crate:

  1. [ ] Find all repeated functions and traits definition scattered through burn crates
  2. [ ] Move all of them in burn-common crate
  3. [ ] Replace the repeated functions and traits call with the ones contained in the burn-common crate
  4. [ ] Optimize these functions with #[inline] and #[inline(always)] attributes

Luni-4 avatar Nov 10 '23 09:11 Luni-4

@Luni-4 We already have burn-common for stuff that is shared between crates, maybe we should move some repeated functions there!

nathanielsimard avatar Nov 10 '23 13:11 nathanielsimard

@nathanielsimard

Thank you for pointing me to the right directory! Yeah, we can use burn-common an apply the strategy described above. I agree!

Luni-4 avatar Nov 10 '23 18:11 Luni-4

Closing it as too open ended. We will do as we refactor one by one.

antimora avatar Mar 29 '24 01:03 antimora

Yep, I agree, thanks @antimora!

Luni-4 avatar Mar 29 '24 08:03 Luni-4