reshape3DToMatrixGPU function
Implementation
GPUTensor<Matrix> reshape3DToMatrixGPU(
GPUTensor<Tensor3D> t, int rows, int cols, CommandBuffer tape,
{GPUTensor<Matrix>? outTensor}) {
GPUTensor<Matrix> out =
outTensor ?? GPUTensor<Matrix>.empty(<int>[rows, cols]);
tape.putInt(OP_COPY);
tape.putString(t.id);
tape.putString(out.id);
out.creator = GPUNode(
<GPUTensor>[t],
(CommandBuffer bTape) {
bTape.putInt(OP_ADD_INTO);
bTape.putString(out.gradId);
bTape.putString(t.gradId);
},
opName: 'reshape3DToMatrixGPU',
cost: 0,
);
return out;
}