Skip to content

Commit

Permalink
Merge pull request tensorflow#88 from adamcrume/master
Browse files Browse the repository at this point in the history
Fix memory issues uncovered by valgrind
  • Loading branch information
adamcrume committed Jun 13, 2017
2 parents 27bc757 + 769258b commit 73ed289
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ impl<'a> OperationDescription<'a> {
unsafe {
tf::TF_SetAttrTensor(self.inner,
c_attr_name.as_ptr(),
value.into_ptr(),
value.inner,
status.inner());
}
status.into_result()
Expand All @@ -973,7 +973,7 @@ impl<'a> OperationDescription<'a> {
let c_attr_name = try!(CString::new(attr_name));
let mut status = Status::new();
unsafe {
let ptrs: Vec<*mut tf::TF_Tensor> = value.into_iter().map(|x| x.into_ptr()).collect();
let ptrs: Vec<*mut tf::TF_Tensor> = value.into_iter().map(|x| x.inner).collect();
tf::TF_SetAttrTensorList(self.inner,
c_attr_name.as_ptr(),
ptrs.as_ptr() as *const *const tf::TF_Tensor,
Expand Down

0 comments on commit 73ed289

Please sign in to comment.