Memory order like another array

Đang mở
#1,072 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
data

Hướng nghiên cứu

Start by reading the Array3::from_elem, is_standard_layout(), dim(), clone(), and f() entry points shown in the issue. Trace how array layout is represented and determine the expected behavior for a new array with different dimensions. Done means the intended layout-preserving API is defined, implemented, and tested for both standard and non-standard layouts.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement good first issue

One of my function needs to create a new array with the same order as the input. I know I can use clone() when both arrays have the same dimension, but when it's not the case, it's more complex.

fn binary_dilation(mask: &Array3<bool>) -> Array3<bool> {
    let (width, height, depth) = mask.dim();
    let dim = (width + etc., ...);
    let mut new_mask = if mask.is_standard_layout() {
        Array3::from_elem(dim, false)
    } else {
        Array3::from_elem(dim.f(), false)
    };
    // Do something
}

Is there a one-liner for this? Something like

Array3::from_elem(dim.order_of(mask), false)

or anytning that doesn't require an if?

Ngôn ngữ chính
Rust
Star
4.3k
Fork
391
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của rust-ndarray/ndarray

Tất cả issue của rust-ndarray/ndarray

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.