license import { KernelBackend } from './backends/backend' ; import { ENGINE , Engine , MemoryInfo , ProfileInfo , ScopeFn , TimingInfo } from './engine' ; import { env } from './environment' ; import { Platform } from './platforms/platform' ; import { setDeprecationWarningFn , Tensor } from './tensor' ; import { TensorContainer } from './tensor_types' ; import { getTensorsInContainer } from './tensor_util' ; doc export function enableProdMode ( ) { env ( ) . set ( 'PROD' , true ) ; } doc export function enableDebugMode ( ) { env ( ) . set ( 'DEBUG' , true ) ; } /** Globally disables deprecation warnings */ export function disableDeprecationWarnings ( ) { env ( ) . set ( 'DEPRECATION_WARNINGS_ENABLED' , false ) ; console . warn ( `TensorFlow.js deprecation warnings have been disabled.` ) ; } /** Warn users about deprecated functionality. */ export function deprecationWarn ( msg ) { if ( env ( ) . getBool ( 'DEPRECATION_WARNINGS_ENABLED' ) ) { console . warn ( msg + ' You can disable deprecation warnings with ' + 'tf.disableDeprecationWarnings().' ) ; } } setDeprecationWarningFn ( deprecationWarn ) ; doc export function disposeVariables ( ) { ENGINE . disposeVariables ( ) ; } doc export function engine ( ) { return ENGINE ; } doc export function memory ( ) { return ENGINE . memory ( ) ; } doc export function profile ( f ) { return ENGINE . profile ( f ) ; } param nameOrFn param fn doc export function tidy < T extends TensorContainer > ( nameOrFn , fn ? ) { return ENGINE . tidy ( nameOrFn , fn ) ; } param container doc export function dispose ( container ) { const tensors = getTensorsInContainer ( container ) ; tensors . forEach ( tensor => tensor . dispose ( ) ) ; } param result doc export function keep < T extends Tensor > ( result ) { return ENGINE . keep ( result ) ; } param f doc export function time ( f ) { return ENGINE . time ( f ) ; } param backendName doc export function setBackend ( backendName ) { return ENGINE . setBackend ( backendName ) ; } doc export function ready ( ) { return ENGINE . ready ( ) ; } doc export function getBackend ( ) { return ENGINE . backendName ; } doc export function removeBackend ( name ) { ENGINE . removeBackend ( name ) ; } /**
 * Finds the backend registered under the provided name. Returns null if the
 * name is not in the registry, or the registration hasn't finished yet.
 */ export function findBackend ( name ) { return ENGINE . findBackend ( name ) ; } /**
 * Finds the backend factory registered under the provided name. Returns a
 * function that produces a new backend when called. Returns null if the name
 * is not in the registry.
 */ export function findBackendFactory ( name ) { return ENGINE . findBackendFactory ( name ) ; } param factory param priority return doc export function registerBackend ( name , factory , priority = 1 ) { return ENGINE . registerBackend ( name , factory , priority ) ; } doc export function backend ( ) { return ENGINE . backend ; } param platformName param platform export function setPlatform ( platformName , platform ) { env ( ) . setPlatform ( platformName , platform ) ; }