-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
set_col() docs could do with an example.
It is not clear what the expected array for new_col should look like. I have tried dims [3, 1, 1, 1] and [1, 3, 1 ,1], both times an error was thrown about incorrect size.
let range_a: Vec<u8> = (1..4).collect();
let range_b: Vec<u8> = (4..7).collect();
let dims = Dim4::new(&[1, 3, 1, 1]);
let mut range_a_af = af::Array::new(&range_a, dims);
let range_b_af = af::Array::new(&range_b, dims);
af_print!("range_a_af:", range_a_af);
// [1 3 1 1]
// 1 2 3
af_print!("range_b_af:", range_b_af);
// [1 3 1 1]
// 4 5 6
// I'd like all values in a column to be changed to those the values in the given array or the given arrays matching column, I assume for a scalar value I'd use a constant array(sized to elements in the column or matching dims depending how this method works
range_a_af = set_col(&range_a_af, &range_b_af, 0); // should replace 1 with 4?
af_print!("range_a_af == [4, 2, 3]?: ", range_a_af);This throws the following error:
In function void assign(opencl::Array<T>&, const unsigned int&, const af_seq*, const opencl::Array<outType>&) [with Tout = unsigned char; Tin = unsigned char; af_seq = af_seq]
In file src/api/c/assign.cpp:59
Size mismatch between input and output
thread 'main' panicked at 'Error message: Size is incorrect', /home/pola/.cargo/registry/src/github.com-1ecc6299db9ec823/arrayfire-3.4.3/src/error.rs:66
This might be due to the indexing bug that @9prady9 fixed here. Either that or I've misunderstood how to use this method.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels