MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / builtin_func

Function builtin_func

imperative/python/test/unit/core/test_custom_op.py:86–88  ·  view source on GitHub ↗
(lhs, rhs, smooth)

Source from the content-addressed store, hash-verified

84 return lhs_np, rhs_np, ograd_np
85
86 def builtin_func(lhs, rhs, smooth):
87 out = lhs + rhs
88 return F.where(out < 0, out + smooth, out - smooth)
89
90 def test_elemadd_smooth_train(smooth=0.5, m=4, n=2, seed=2021):
91 lhs_np, rhs_np, ograd_np = gen_elemadd_data(seed, (m, n))

Callers 4

test_matmul_scaleFunction · 0.85
test_matmul_scale_traceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected