1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | import { HashTableMap, NamedTensorMap } from '../data/types';
|
19 | import { HashTable } from './hash_table';
|
20 |
|
21 |
|
22 |
|
23 | export declare class ResourceManager {
|
24 | readonly hashTableNameToHandle: NamedTensorMap;
|
25 | readonly hashTableMap: HashTableMap;
|
26 | constructor(hashTableNameToHandle?: NamedTensorMap, hashTableMap?: HashTableMap);
|
27 | /**
|
28 | * Register a `HashTable` in the resource manager.
|
29 | *
|
30 | * The `HashTable` can be retrieved by `resourceManager.getHashTableById`,
|
31 | * where id is the table handle tensor's id.
|
32 | *
|
33 | * @param name Op node name that creates the `HashTable`.
|
34 | * @param hashTable The `HashTable` to be added to resource manager.
|
35 | */
|
36 | addHashTable(name: string, hashTable: HashTable): void;
|
37 | /**
|
38 | * Get the table handle by node name.
|
39 | * @param name Op node name that creates the `HashTable`. This name is also
|
40 | * used in the inputs list of lookup and import `HashTable` ops.
|
41 | */
|
42 | getHashTableHandleByName(name: string): import("@tensorflow/tfjs-core").Tensor<import("@tensorflow/tfjs-core").Rank>;
|
43 | /**
|
44 | * Get the actual `HashTable` by its handle tensor's id.
|
45 | * @param id The id of the handle tensor.
|
46 | */
|
47 | getHashTableById(id: number): HashTable;
|
48 | /**
|
49 | * Dispose `ResourceManager`, including its hashTables and tensors in them.
|
50 | */
|
51 | dispose(): void;
|
52 | }
|