Find
Function
Search for the elements of the input tensor in the lookup table and return the corresponding values.
Prototype
1 | int Find(const TableInfo &info, const int64_t *keys, float *values, const float *defaultValue, int64_t length); |
- keys and length are of the int64_t type.
- values and default_value are of the float type.
- The valid length of the pointer is determined by the user.
- Ensure that the valid spaces of the input pointers, including the internal pointers of the structure, do not overlap.
Parameters
Parameter |
Input/Output |
Description |
Constraint |
|---|---|---|---|
info |
Input |
Stores structures used to search for necessary fields. Structures include:
|
|
keys |
Input |
Key used for search. |
The pointer is not null, and the array does not contain emptyKey or deletedKey. |
values |
Input |
Value used for search, with the found value as the output. |
This pointer is not null. |
defaultValue |
Input |
Value inserted in case the value is not found. |
This pointer is not null. |
length |
Input |
Number of keys to be queried. |
The value range is (0, 2^63 – 1]. The length of length is the same as that of keys, which must be checked by the user to prevent security issues such as buffer overflow. |