Standard IWeightsLoader interface that loads weights from the local filesystem.
More...
#include <FilesystemWeightsLoader.h>
Standard IWeightsLoader interface that loads weights from the local filesystem.
Applications should feel to augment or replace this class with domain-specific functionality.
- Warning
- This class does not use OS-level sandboxing. Security-critical operations should use a custom weights loader.
◆ FilesystemWeightsLoader() [1/2]
FilesystemWeightsLoader::FilesystemWeightsLoader |
( |
const std::string & |
weightsPrefix | ) |
|
|
explicit |
Creates a weights loader that operates in a particular directory.
- Parameters
-
weightsPrefix | Path string to prepend to generated weights filenames before loading |
◆ FilesystemWeightsLoader() [2/2]
FilesystemWeightsLoader::FilesystemWeightsLoader |
( |
| ) |
|
|
protected |
Default constructor that assigns no weights prefix.
Used by derived classes that can't call the ctor overload with an argument due to RefObjectBase. Such classes should call init() inside their own constructors.
◆ allowBinaryWeights()
bool FilesystemWeightsLoader::allowBinaryWeights |
( |
| ) |
const |
|
noexcept |
Returns true if binary support is enabled.
◆ allowNumpyWeights()
bool FilesystemWeightsLoader::allowNumpyWeights |
( |
| ) |
const |
|
noexcept |
Returns true if NumPy support is enabled.
◆ allowRandomWeights()
bool FilesystemWeightsLoader::allowRandomWeights |
( |
| ) |
const |
|
noexcept |
Returns true if random weights generation is enabled.
◆ getWeightsForLayer()
Retrieves a weights data buffer in a canonical format.
- Parameters
-
ppWeightsDataOut | Pointer to a variable receiving the created IWeightsData object |
pNetwork | NetworkRuntime containing the layer |
pLayer | Layer to retrieve data for |
pName | Buffer to retrieve |
◆ init()
void FilesystemWeightsLoader::init |
( |
const std::string & |
weightsPrefix | ) |
|
|
protected |
Assigns a weights prefix and performs common initialization.
- Parameters
-
weightsPrefix | Path string to prepend to generated weights filenames before loading |
◆ setAllowBinaryWeights()
NeuralResult FilesystemWeightsLoader::setAllowBinaryWeights |
( |
bool |
allowBinary | ) |
|
|
noexcept |
Turn binary support on or off.
◆ setAllowNumpyWeights()
NeuralResult FilesystemWeightsLoader::setAllowNumpyWeights |
( |
bool |
allowNumpy | ) |
|
|
noexcept |
Turn NumPy support on or off.
◆ setAllowRandomWeights()
NeuralResult FilesystemWeightsLoader::setAllowRandomWeights |
( |
bool |
allowRandoms | ) |
|
|
noexcept |
Turn random weights generation on or off.
The documentation for this class was generated from the following files: