UNPKG

@tensorflow/tfjs-core

Version:

Hardware-accelerated JavaScript library for machine intelligence

12 lines 664 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var OneHotProgram = (function () { function OneHotProgram(numIndices, depth, onValue, offValue) { this.variableNames = ['indices']; this.outputShape = [numIndices, depth]; this.userCode = "\n void main() {\n ivec2 coords = getOutputCoords();\n int index = round(getIndices(coords.x));\n setOutput(mix(float(" + offValue + "), float(" + onValue + "),\n float(index == coords.y)));\n }\n "; } return OneHotProgram; }()); exports.OneHotProgram = OneHotProgram; //# sourceMappingURL=onehot_gpu.js.map