diff options
author | Young Jin Kim <youki@microsoft.com> | 2019-06-19 03:52:21 +0300 |
---|---|---|
committer | Young Jin Kim <youki@microsoft.com> | 2019-06-19 03:52:21 +0300 |
commit | 93b752c34968db0cd989899f131ccf4426002542 (patch) | |
tree | a7a75ca6a16a64801c8fae9ddeecfc0721060922 /src/graph | |
parent | a71bcb5f7c9ae3b0514fbc53d85ad4e6349a8242 (diff) |
fix for the case FBGEMM is not used
Diffstat (limited to 'src/graph')
-rwxr-xr-x | src/graph/expression_operators.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/graph/expression_operators.cpp b/src/graph/expression_operators.cpp index d7bfd19c..88a6222d 100755 --- a/src/graph/expression_operators.cpp +++ b/src/graph/expression_operators.cpp @@ -508,6 +508,7 @@ Expr affine(Expr a, Expr b, Expr bias, bool transA, bool transB, float scale) { return tuner->run(); } else { +#if USE_FBGEMM if(b->memoize()) { auto packed = cpu::variant::pack(b, cpu::variant::PackMatrix::B, transB, clipValue); // auto packed = transB ? @@ -533,6 +534,14 @@ Expr affine(Expr a, Expr b, Expr bias, bool transA, bool transB, float scale) { std::vector<Expr> nodes = {clip(a, clipValue), clip(b, clipValue), bias, ones}; return Expression<AffineNodeOp>(nodes, transA, transB, scale); } +#else // USE_FBGEMM + // cpu int16 version + return cpu::int16::affine( + cpu::int16::quantize(transA ? transpose(a) : a, clipValue), + cpu::int16::quantize(transB ? b : transpose(b), clipValue), + bias, + scale); +#endif // USE_FBGEMM } } else { // general version, MKL, CBlas or CUDA |