MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / array_fill

Function array_fill

mlx/data/Array.cpp:124–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122
123template <class T>
124void array_fill(void* data, int64_t size, double value) {
125 auto data_t = reinterpret_cast<T*>(data);
126 auto value_t = static_cast<T>(value);
127 for (int64_t i = 0; i < size; i++) {
128 data_t[i] = value_t;
129 }
130}
131
132void Array::fill(double value) {
133 ARRAY_DISPATCH(this, array_fill, data_.get(), size(), value);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected