onnxruntime/js/web/lib/onnxjs/backends/webgl/ops/dropout.ts
Yulong Wang 4ebc9c3b5e
[JS] onnxruntime-web (#7394)
* add web

* add script and test

* fix lint

* add test/data/ops

* add test/data/node/ to gitignore

* modify scripts

* add onnxjs

* fix tests

* fix test-runner

* fix sourcemap

* fix onnxjs profiling

* update test list

* update README

* resolve comments

* set wasm as default backend

* rename package

* update copyright header

* do not use class "Buffer" in browser context

* revise readme
2021-04-27 00:04:25 -07:00

22 lines
923 B
TypeScript

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import {Dropout} from '../../../ops/dropout';
import {Tensor} from '../../../tensor';
import {WebGLInferenceHandler} from '../inference-handler';
import {ProgramInfo, RunData, WebGLOperator} from '../types';
export class WebGLDropout extends Dropout implements WebGLOperator {
run(inferenceHandler: WebGLInferenceHandler, inputs: Tensor[]): Tensor[] {
if (this.testMode) {
return [inputs[0]];
}
throw new Error('Non test mode Dropout is not implemented yet');
}
createProgramInfo(_handler: WebGLInferenceHandler, _inputs: Tensor[]): ProgramInfo {
throw new Error('Non test mode Dropout is not implemented yet');
}
createRunData(_handler: WebGLInferenceHandler, _programInfo: ProgramInfo, _inputs: Tensor[]): RunData {
throw new Error('Non test mode Dropout is not implemented yet');
}
}