MCPcopy Create free account
hub / github.com/tensorflow/tfjs / step

Function step

tfjs-backend-webgpu/src/kernels/Step.ts:24–33  ·  view source on GitHub ↗
(
    {inputs, attrs, backend}:
        {inputs: UnaryInputs, attrs: StepAttrs, backend: WebGPUBackend})

Source from the content-addressed store, hash-verified

22import {UnaryOpProgram} from '../unary_op_webgpu';
23
24export function step(
25 {inputs, attrs, backend}:
26 {inputs: UnaryInputs, attrs: StepAttrs, backend: WebGPUBackend}):
27 TensorInfo {
28 const {x} = inputs;
29 const program =
30 new UnaryOpProgram(x.shape, UnaryOpType.STEP, 'stepAlpha : f32,');
31 const uniformData = [{type: 'float32', data: [attrs.alpha]}];
32 return backend.runWebGPUProgram(program, [x], x.dtype, uniformData);
33}
34
35export const stepConfig: KernelConfig = {
36 kernelName: Step,

Callers

nothing calls this directly

Calls 1

runWebGPUProgramMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…