@hoff97/tensor-js
Version:
PyTorch like deep learning inferrence library
13 lines • 591 B
JavaScript
import { BinaryOperation } from '../../../../ops/gpu/binary/binaryOperation';
import { Dispatcher } from '../../../../ops/gpu/dispatcher';
import { gpuConstructor } from '../../../../tensor/gpu/tensor';
export class BCEBackOperation extends BinaryOperation {
constructor(tensorConstructor, dtype, allocator) {
super(tensorConstructor, dtype, allocator);
}
getOp(a, b) {
return `${b} == 1.0 ? -1.0/${a} : 1.0/(1.0-${a})`;
}
}
export const defaultBCEBackD = new Dispatcher((dtype) => new BCEBackOperation(gpuConstructor, dtype));
//# sourceMappingURL=gpu.js.map