(
{inputs, attrs, backend}:
{inputs: UnaryInputs, attrs: StepAttrs, backend: MathBackendWebGL})
| 21 | import {CHECK_NAN_SNIPPET, UnaryOpProgram} from '../unaryop_gpu'; |
| 22 | |
| 23 | export function step( |
| 24 | {inputs, attrs, backend}: |
| 25 | {inputs: UnaryInputs, attrs: StepAttrs, backend: MathBackendWebGL}): |
| 26 | TensorInfo { |
| 27 | const {x} = inputs; |
| 28 | const opSnippet = CHECK_NAN_SNIPPET + ` |
| 29 | return x > 0.0 ? 1.0 : float(${attrs.alpha}); |
| 30 | `; |
| 31 | |
| 32 | const program = new UnaryOpProgram(x.shape, opSnippet); |
| 33 | |
| 34 | return backend.runWebGLProgram(program, [x], x.dtype); |
| 35 | } |
| 36 | |
| 37 | export const stepConfig: KernelConfig = { |
| 38 | kernelName: Step, |
nothing calls this directly
no test coverage detected
searching dependent graphs…