@tensorflow/tfjs-core
Version:
Hardware-accelerated JavaScript library for machine intelligence
10 lines • 574 B
JavaScript
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;
}());
export { OneHotProgram };
//# sourceMappingURL=onehot_gpu.js.map