logGPU<T> function
Appends the commands for applying the log(v) exponential function on every element of v to tape.
Implementation
GPUTensor<T> logGPU<T>(GPUTensor<T> a, CommandBuffer tape,
{GPUTensor<T>? outTensor}) {
GPUTensor<T> out = outTensor ?? GPUTensor<T>.empty(a.shape);
tape.putInt(OP_LOG_ELEMENTWISE);
tape.putString(a.id);
tape.putString(out.id);
out.creator = GPUNode(
<GPUTensor>[a],
(CommandBuffer bTape) {
bTape.putInt(OP_LOG_BACKWARD);
bTape.putString(out.gradId);
bTape.putString(a.id);
bTape.putString(a.gradId);
},
opName: 'logGPU',
);
return out;
}