From cf67c7165aa839a433b74c977498a51deb404da9 Mon Sep 17 00:00:00 2001 From: raver119 Date: Tue, 25 Feb 2020 15:20:51 +0300 Subject: [PATCH] nano fix Signed-off-by: raver119 --- .../include/ops/declarable/generic/activations/identity.cpp | 3 ++- .../ops/declarable/generic/parity_ops/stop_gradient.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libnd4j/include/ops/declarable/generic/activations/identity.cpp b/libnd4j/include/ops/declarable/generic/activations/identity.cpp index c2b600374..465231937 100644 --- a/libnd4j/include/ops/declarable/generic/activations/identity.cpp +++ b/libnd4j/include/ops/declarable/generic/activations/identity.cpp @@ -26,9 +26,10 @@ namespace nd4j { namespace ops { OP_IMPL(identity, 1, 1, true) { + auto z = OUTPUT_VARIABLE(0); + if (!block.isInplace()) { auto first = INPUT_VARIABLE(0); - auto z = OUTPUT_VARIABLE(0); // we hope for memcpy here z->assign(first); diff --git a/libnd4j/include/ops/declarable/generic/parity_ops/stop_gradient.cpp b/libnd4j/include/ops/declarable/generic/parity_ops/stop_gradient.cpp index 746e1f9cf..9bb70d38f 100644 --- a/libnd4j/include/ops/declarable/generic/parity_ops/stop_gradient.cpp +++ b/libnd4j/include/ops/declarable/generic/parity_ops/stop_gradient.cpp @@ -26,10 +26,10 @@ namespace nd4j { namespace ops { OP_IMPL(stop_gradient, 1, 1, true) { + auto out = OUTPUT_VARIABLE(0); + if (!block.isInplace()) { auto x = INPUT_VARIABLE(0); - auto out = OUTPUT_VARIABLE(0); - // we hope for memcpy here out->assign(x); }