21 template <
class x_T,
class w_T>
27 template <
class x_T,
class w_T>
38 template <
class x_T,
class w_T>
49 template <
class x_T,
class w_T>
62 template <
class x_T,
class w_T>
68 template <
class x_T,
class w_T>
72 ap_fixed<2 * (decltype(w_T::weight)::width + x_T::width), (decltype(w_T::weight)::width + x_T::width)>;
75 r_T y =
static_cast<r_T>(
a) <<
w.weight;
78 return w.sign == 1 ? y : static_cast<r_T>(-y);
84 template <
class data_T,
class res_T,
typename CONFIG_T>
85 inline typename std::enable_if<std::is_same<data_T, ap_uint<1>>
::value &&
86 std::is_same<typename CONFIG_T::weight_t, ap_uint<1>>
::value,
87 ap_int<nnet::ceillog2(CONFIG_T::n_in) + 2>>
::type 88 cast(
typename CONFIG_T::accum_t x) {
89 return (ap_int<
nnet::ceillog2(CONFIG_T::n_in) + 2>)(
x - CONFIG_T::n_in / 2) * 2;
92 template <
class data_T,
class res_T,
typename CONFIG_T>
93 inline typename std::enable_if<std::is_same<data_T, ap_uint<1>>
::value &&
94 !std::is_same<typename CONFIG_T::weight_t, ap_uint<1>>
::value,
96 cast(
typename CONFIG_T::accum_t x) {
100 template <
class data_T,
class res_T,
typename CONFIG_T>
101 inline typename std::enable_if<(!std::is_same<data_T, ap_uint<1>>
::value), res_T>::
type cast(
102 typename CONFIG_T::accum_t x) {
constexpr int ceillog2(int x)
static r_T product(x_T a, w_T w)
std::enable_if< std::is_same< data_T, ap_uint< 1 > >::value &&std::is_same< typename CONFIG_T::weight_t, ap_uint< 1 > >::value, ap_int< nnet::ceillog2(CONFIG_T::n_in)+2 > >::type cast(typename CONFIG_T::accum_t x)
static auto product(x_T a, w_T w) -> decltype(a *w)
ap_fixed< 2 *(decltype(w_T::weight)::width+x_T::width),(decltype(w_T::weight)::width+x_T::width)> r_T
static x_T product(x_T a, w_T w)
static auto product(x_T a, w_T w) -> decltype(-a)
static auto product(x_T a, w_T w) -> decltype(-w)
static auto product(x_T a, w_T w) -> decltype(-a)