From 9f8909e85c439bdc01e4eeff6a5c82a8d6469b96 Mon Sep 17 00:00:00 2001 From: SparrowLii Date: Fri, 19 Feb 2021 09:03:07 +0800 Subject: [PATCH] Modify the docs and visibility of broadcast_with --- src/impl_methods.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/impl_methods.rs b/src/impl_methods.rs index 815243ed1..0e8cbc4e2 100644 --- a/src/impl_methods.rs +++ b/src/impl_methods.rs @@ -1707,7 +1707,8 @@ where unsafe { Some(ArrayView::new(self.ptr, dim, broadcast_strides)) } } - /// Calculate the views of two ArrayBases after broadcasting each other, if possible. + /// For two arrays or views, find their common shape if possible and + /// broadcast them as array views into that shape. /// /// Return `ShapeError` if their shapes can not be broadcast together. /// @@ -1720,7 +1721,7 @@ where /// assert_eq!(a1, arr2(&[[2, 2, 2], [3, 3, 3], [4, 4, 4]])); /// assert_eq!(b1, arr2(&[[5, 6, 7], [5, 6, 7], [5, 6, 7]])); /// ``` - pub fn broadcast_with<'a, 'b, B, S2, E>(&'a self, other: &'b ArrayBase) -> + pub(crate) fn broadcast_with<'a, 'b, B, S2, E>(&'a self, other: &'b ArrayBase) -> Result<(ArrayView<'a, A, >::Output>, ArrayView<'b, B, >::Output>), ShapeError> where S: Data,