Skip to content

Commit

Permalink
refactor/tests: fix and refactor tests
Browse files Browse the repository at this point in the history
Fix tests to work with new memory management API. Refactor functions
for writing data to tensors and checking their contents. Merge set up
stage and compute/verify stage: it's much nicer to see input and output
values in one place. Refactor tests to be generic on backend and use
macros to eliminate repetitive test definitions.
  • Loading branch information
alexandermorozov committed Apr 23, 2016
1 parent cde71d0 commit 1c25b02
Show file tree
Hide file tree
Showing 2 changed files with 206 additions and 472 deletions.
2 changes: 1 addition & 1 deletion src/frameworks/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ mod test {
#[test]
fn it_converts_correctly_to_and_from_matrix() {
let backend = get_native_backend();
let mut a = SharedTensor::<f32>::new(&vec![3, 2]).unwrap();
let mut a = SharedTensor::<f32>::new(&vec![3, 2]);
write_to_memory(a.write_only(backend.device()).unwrap(),
&[2f32, 5f32,
2f32, 5f32,
Expand Down
Loading

0 comments on commit 1c25b02

Please sign in to comment.