UNPKG

federer

Version:

Experiments in asynchronous federated learning and decentralized learning

31 lines 1.39 kB
import * as tf from "@tensorflow/tfjs-node"; import { Dataset, DataSubset } from "./dataset"; import { Weights } from "./weights"; declare type TensorContainer = void | Weights | Dataset | DataSubset | TensorContainer[] | { [x: string]: any; }; /** * Equivalent to `tf.tidy`, but only supporting functions returning our data * structures ({@link Weights}, {@link Dataset}, {@link DataSubset}, ...). * * @param fn Function to execute * @returns The value returned by `fn` */ export declare function tidy<T extends TensorContainer>(fn: () => T): T; /** * Equivalent to `tf.tidy`, but for functions returning our data structures * ({@link Weights}, {@link Dataset}, {@link DataSubset}, ...). * * Unlike `tf.tidy`, this function supports tidying up after async functions. * However, it does so by using a mutex lock. This means that the no two * promises wrapped in {@link tidySequentialAsync} can run concurrently. Note * that there is some slight nuance here: the promises that they create * internally can run concurrently, but the returned promise cannot run * concurrently with another wrapped promise. * * @param fn Async function to execute * @returns A promise of the value returned by `fn` */ export declare function tidySequentialAsync<T extends TensorContainer | tf.TensorContainer>(fn: () => Promise<T>): Promise<T>; export {}; //# sourceMappingURL=tidy.d.ts.map