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

Function is_binary

mlx/compile.cpp:47–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47bool is_binary(const Primitive& p) {
48 return (
49 typeid(p) == typeid(Add) || typeid(p) == typeid(Divide) ||
50 typeid(p) == typeid(Equal) || typeid(p) == typeid(Greater) ||
51 typeid(p) == typeid(GreaterEqual) || typeid(p) == typeid(Less) ||
52 typeid(p) == typeid(LessEqual) || typeid(p) == typeid(LogicalNot) ||
53 typeid(p) == typeid(LogicalAnd) || typeid(p) == typeid(LogicalOr) ||
54 typeid(p) == typeid(LogAddExp) || typeid(p) == typeid(Maximum) ||
55 typeid(p) == typeid(Minimum) || typeid(p) == typeid(Multiply) ||
56 typeid(p) == typeid(NotEqual) || typeid(p) == typeid(Power) ||
57 typeid(p) == typeid(Subtract) || typeid(p) == typeid(BitwiseBinary) ||
58 typeid(p) == typeid(ArcTan2));
59}
60
61bool is_ternary(const Primitive& p) {
62 return typeid(p) == typeid(Select);

Callers 1

is_fusableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected