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); }