MCPcopy Create free account
hub / github.com/pytorch/executorch / _std_handler

Function _std_handler

backends/mlx/ops.py:3317–3339  ·  view source on GitHub ↗

Handle aten.std - standard deviation of elements along axes.

(P: MLXProgramBuilder, n: Node)

Source from the content-addressed store, hash-verified

3315
3316@REGISTRY.register(target=[torch.ops.aten.std.correction])
3317def _std_handler(P: MLXProgramBuilder, n: Node) -> Slot:
3318 """Handle aten.std - standard deviation of elements along axes."""
3319 args = P.args(n)
3320 require_args(args, 1, 2, "aten.std")
3321 require_kwargs(P.kwargs(n), {"correction", "keepdim"}, "aten.std")
3322 x = args[0]
3323 axes, _ = normalize_reduction_dim(args)
3324
3325 correction = n.kwargs.get("correction", None)
3326 keepdim = n.kwargs.get("keepdim", False)
3327 ddof = int(correction) if correction is not None else 1
3328
3329 out = P.make_or_get_slot(n)
3330 P.emit(
3331 StdNode(
3332 x=P.slot_to_tid(x),
3333 out=P.slot_to_tid(out),
3334 axes=axes,
3335 keepdims=keepdim,
3336 ddof=ddof,
3337 )
3338 )
3339 return out
3340
3341
3342@REGISTRY.register(target=[torch.ops.aten.max.default])

Callers

nothing calls this directly

Calls 9

require_argsFunction · 0.85
require_kwargsFunction · 0.85
normalize_reduction_dimFunction · 0.85
argsMethod · 0.80
kwargsMethod · 0.80
emitMethod · 0.80
slot_to_tidMethod · 0.80
getMethod · 0.45
make_or_get_slotMethod · 0.45

Tested by

no test coverage detected