[Question]In what situations will af::copy() fail
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- backend-api-design
Research direction
The issue provides a TEST_CASE("af::copy()") using af::array, af::seq, af::span, and af::copy. Start by reproducing the supplied test and inspecting the af::copy API behavior; done requires a clear explanation of the situations in which af::copy() fails.
Written by the indexing model from the issue text.
Description
TEST_CASE("af::copy()") {
double data[] = {1.0, 2.0, 3.0, 4.0, 5, 6, 7, 8,9,10,11,12,13,14,15,16,17,18};
af::array a(2, 3, 3, data);
af::array b(2, 3, 3, af::dtype::f64);
af::array at = a(af::seq(0, 1), af::seq(0, 1), af::seq(0, 1));
af::array bt = b(af::seq(0, 1), af::seq(0, 1), af::seq(0, 1));
af::copy(bt, at, af::span);
CHECK(b(0, 0, 0).scalar<double>() == 0.0);
CHECK(b(1, 0, 0).scalar<double>() == 0.0);
CHECK(b(0, 1, 0).scalar<double>() == 0.0);
CHECK(b(1, 1, 0).scalar<double>() == 0.0);
af::array at1 = a(af::seq(0, 1), af::seq(0, 0), af::seq(0, 0));
af::array bt1 = b(af::seq(0, 1), af::seq(0, 0), af::seq(0, 0));
af::copy(bt1, at1, af::span);
CHECK(b(0, 0, 0).scalar<double>() == 1.0);
CHECK(b(1, 0, 0).scalar<double>() == 2.0);
CHECK(b(0, 1, 0).scalar<double>() == 0.0);
CHECK(b(1, 1, 0).scalar<double>() == 0.0);
}
- Dominant language
- C++
- Stars
- 4.9k
- Forks
- 555
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arrayfire/arrayfire
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in arrayfire/arrayfire
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantStack/git2cpp#187 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100