pub struct MapBuilder { /* private fields */ }Expand description
Builder for Map constructs. Created by FlowBuilder::map.
Implementations§
Source§impl MapBuilder
impl MapBuilder
Sourcepub fn batched(self) -> Self
pub fn batched(self) -> Self
Fast path: pass full tensor to body in one call instead of element-wise.
Sourcepub fn each(self) -> FlowBuilder
pub fn each(self) -> FlowBuilder
Apply body to each element along dim 0 of the current stream.
Sourcepub fn over(self, tag: &str) -> FlowBuilder
pub fn over(self, tag: &str) -> FlowBuilder
Iterate over a tagged tensor (backward ref) instead of current stream.
Sourcepub fn slices(self, n: i64) -> FlowBuilder
pub fn slices(self, n: i64) -> FlowBuilder
Decompose last dim into n slices, map body over each, recompose.
For input [B, D] with slices(n): reshape [B, D] → [B*n, D/n],
map body over B*n elements, reshape back to [B, outD*n].
D must be divisible by n.
Auto Trait Implementations§
impl Freeze for MapBuilder
impl !RefUnwindSafe for MapBuilder
impl !Send for MapBuilder
impl !Sync for MapBuilder
impl Unpin for MapBuilder
impl UnsafeUnpin for MapBuilder
impl !UnwindSafe for MapBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more