Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/graph
diff options
context:
space:
mode:
authorYoung Jin Kim <youki@microsoft.com>2019-06-19 03:52:21 +0300
committerYoung Jin Kim <youki@microsoft.com>2019-06-19 03:52:21 +0300
commit93b752c34968db0cd989899f131ccf4426002542 (patch)
treea7a75ca6a16a64801c8fae9ddeecfc0721060922 /src/graph
parenta71bcb5f7c9ae3b0514fbc53d85ad4e6349a8242 (diff)
fix for the case FBGEMM is not used
Diffstat (limited to 'src/graph')
-rwxr-xr-xsrc/graph/expression_operators.cpp9
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