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