From c25a32aa272ff3c753ee8be2ea89457367b38734 Mon Sep 17 00:00:00 2001 From: Ewan Higgs Date: Thu, 21 Jan 2016 00:17:00 +0100 Subject: [PATCH] fix/native: Fix sigmoid_grad to use x_diff instead of x for dx --- src/frameworks/native/helper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/native/helper.rs b/src/frameworks/native/helper.rs index 399a5d1..0a0678a 100644 --- a/src/frameworks/native/helper.rs +++ b/src/frameworks/native/helper.rs @@ -144,7 +144,7 @@ macro_rules! impl_ops_sigmoid_for { result_diff: &mut ::co::tensor::SharedTensor<$t> ) -> Result<(), ::co::error::Error> { if let Some(sig_data) = x.get(self.device()).unwrap().as_native() { - if let Some(sig_dx) = x.get(self.device()).unwrap().as_native() { + if let Some(sig_dx) = x_diff.get(self.device()).unwrap().as_native() { let res = sig_data.as_slice::<$t>().iter() .zip(sig_dx.as_slice::<$t>().iter()) .map(|(t, dt)| ::frameworks::native::helper::sigmoid_grad(t, dt));