From 426e28640a3d3e88130645abb5a54138f8fe1bdb Mon Sep 17 00:00:00 2001 From: AbdelRauf Date: Tue, 23 Feb 2021 21:16:07 +0100 Subject: [PATCH] fusedbatchnorm: fix type mismatching error Signed-off-by: AbdelRauf --- .../include/ops/declarable/generic/nn/fusedBatchNorm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libnd4j/include/ops/declarable/generic/nn/fusedBatchNorm.cpp b/libnd4j/include/ops/declarable/generic/nn/fusedBatchNorm.cpp index ccdf60f40..d9e48d1c1 100644 --- a/libnd4j/include/ops/declarable/generic/nn/fusedBatchNorm.cpp +++ b/libnd4j/include/ops/declarable/generic/nn/fusedBatchNorm.cpp @@ -89,8 +89,8 @@ namespace sd { else { //REQUIRE_TRUE(block.width() == 3, 0, "CUSTOM_OP fused_batch_norm: when isTraining=true then number of input arrays must be equal to 3, but got %i instead !", block.width()); std::vector shape = {iD}; - mean = NDArrayFactory::create_(scale->ordering(), shape, sd::DataType::FLOAT32, block.launchContext()); - variance = NDArrayFactory::create_(scale->ordering(), shape, sd::DataType::FLOAT32, block.launchContext()); + mean = NDArrayFactory::create_(scale->ordering(), shape, scale->dataType(), block.launchContext()); + variance = NDArrayFactory::create_(scale->ordering(), shape, scale->dataType(), block.launchContext()); } @@ -104,7 +104,7 @@ namespace sd { const int restSize = x->lengthOf() / iD; - auto xAffected = NDArrayFactory::create(x->ordering(), {restSize, iD}, sd::DataType::FLOAT32, block.launchContext()); + auto xAffected = NDArrayFactory::create(x->ordering(), {restSize, iD}, mean->dataType(), block.launchContext()); xAffected.assign(xCast); const int restSizeMinusOne = (restSize > 1) ? (restSize - 1) : 1;