MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / constant

Function constant

src/core/data.rs:289–294  ·  view source on GitHub ↗

Create an Array with constant value The trait ConstGenerator has been defined internally for the following types: - i64 - u64 - num::Complex\ a.k.a c32 - num::Complex\ a.k.a c64 - f32 - f64 - i32 - u32 - u8 - i16 - u16 # Parameters - `cnst` is the constant value to be filled in the Array - `dims` is the size of the constant Array # Return Values An Array of given dimensions with

(cnst: T, dims: Dim4)

Source from the content-addressed store, hash-verified

287///
288/// An Array of given dimensions with constant value
289pub fn constant<T>(cnst: T, dims: Dim4) -> Array<T>
290where
291 T: ConstGenerator<OutType = T>,
292{
293 cnst.generate(dims)
294}
295
296/// Create a Range of values
297///

Callers 15

mainFunction · 0.85
convertMethod · 0.85
negMethod · 0.85
thread_move_arrayFunction · 0.85
thread_borrow_arrayFunction · 0.85
access_using_rwlockFunction · 0.85
accum_using_channelFunction · 0.85
macro_seq_array_assignFunction · 0.85
non_macro_seq_assignFunction · 0.85
check_scalar_arithFunction · 0.85

Calls 1

generateMethod · 0.80

Tested by 9

thread_move_arrayFunction · 0.68
thread_borrow_arrayFunction · 0.68
access_using_rwlockFunction · 0.68
accum_using_channelFunction · 0.68
macro_seq_array_assignFunction · 0.68
non_macro_seq_assignFunction · 0.68
check_scalar_arithFunction · 0.68