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

Function real

mlx/ops.cpp:6402–6407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6400}
6401
6402array real(const array& a, StreamOrDevice s /* = {} */) {
6403 if (!issubdtype(a.dtype(), complexfloating)) {
6404 return a;
6405 }
6406 return array(a.shape(), float32, std::make_shared<Real>(to_stream(s)), {a});
6407}
6408
6409array imag(const array& a, StreamOrDevice s /* = {} */) {
6410 if (!issubdtype(a.dtype(), complexfloating)) {

Callers 4

jvpMethod · 0.70
vmapMethod · 0.70
init_arrayFunction · 0.50
init_opsFunction · 0.50

Calls 3

issubdtypeFunction · 0.85
to_streamFunction · 0.85
arrayFunction · 0.70

Tested by

no test coverage detected