mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 19:47:12 +00:00
Let outside CustomOp2 implementations use binary_map/binary_map_vec (#741)
This commit is contained in:
@ -445,7 +445,7 @@ pub fn unary_map_vec<T: Copy, U: Copy, F: FnMut(T) -> U, FV: FnMut(&[T], &mut [U
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This function maps over two strided index sequences.
|
// This function maps over two strided index sequences.
|
||||||
fn binary_map<T: Copy, U: Copy, F: FnMut(T, T) -> U>(
|
pub fn binary_map<T: Copy, U: Copy, F: FnMut(T, T) -> U>(
|
||||||
lhs_l: &Layout,
|
lhs_l: &Layout,
|
||||||
rhs_l: &Layout,
|
rhs_l: &Layout,
|
||||||
lhs: &[T],
|
lhs: &[T],
|
||||||
@ -525,7 +525,7 @@ fn binary_map<T: Copy, U: Copy, F: FnMut(T, T) -> U>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Similar to binary_map but with vectorized variants.
|
// Similar to binary_map but with vectorized variants.
|
||||||
fn binary_map_vec<T: Copy, F: FnMut(T, T) -> T, FV: FnMut(&[T], &[T], &mut [T])>(
|
pub fn binary_map_vec<T: Copy, F: FnMut(T, T) -> T, FV: FnMut(&[T], &[T], &mut [T])>(
|
||||||
lhs_l: &Layout,
|
lhs_l: &Layout,
|
||||||
rhs_l: &Layout,
|
rhs_l: &Layout,
|
||||||
lhs: &[T],
|
lhs: &[T],
|
||||||
|
Reference in New Issue
Block a user