8000 implement creating SliceArg from arbitrary Dimension by SparrowLii · Pull Request #909 · rust-ndarray/ndarray · GitHub
[go: up one dir, main page]

Skip to content

implement creating SliceArg from arbitrary Dimension #909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into slicearg
  • Loading branch information
SparrowLii authored Feb 5, 2021
commit 94aab160ab784b53cb4822d9d23ffa31a4c061f3
6 changes: 6 additions & 0 deletions src/dimension/dimension_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,10 +971,16 @@ impl Dimension for IxDyn {
fn from_dimension<D2: Dimension>(d: &D2) -> Option<Self> {
Some(IxDyn(d.slice()))
}

#[inline]
fn slice_arg_from<T: AsRef<[SliceOrIndex]>>(index: &T) -> Result<&Self::SliceArg, ShapeError> {
Ok(index.as_ref())
}

fn into_dyn(self) -> IxDyn {
self
}

private_impl! {}
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0