Skip to content

Commit

Permalink
Fix (quant): propagate device and dtype in subinjector (#942)
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 authored Apr 29, 2024
1 parent bae1e26 commit cae4004
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/brevitas/quant/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ class MSESymmetricScaleSubInjector(MSESubInjectorBase):
mse_init_op = AbsMax
stats_impl = MSE
stats_reduce_dim = (this << 1).stats_reduce_dim
device = (this << 1).device
type = (this << 1).type


class MSEAsymmetricScaleSubInjector(MSESubInjectorBase):
Expand All @@ -443,6 +445,8 @@ class MSEAsymmetricScaleSubInjector(MSESubInjectorBase):
mse_init_op = AbsMinMax
stats_impl = MSE
stats_reduce_dim = (this << 1).stats_reduce_dim
device = (this << 1).device
type = (this << 1).type


class MSEZeroPointSubInjector(MSESubInjectorBase):
Expand All @@ -453,6 +457,8 @@ class MSEZeroPointSubInjector(MSESubInjectorBase):
mse_search_method = 'grid'
stats_impl = MSE
stats_reduce_dim = (this << 1).stats_reduce_dim
device = (this << 1).device
type = (this << 1).type


class MSEAsymmetricScale(ExtendedInjector):
Expand Down

0 comments on commit cae4004

Please sign in to comment.