TTConvFilters#
Currently, this API is unsupported in Python
-
class TTConvFilters : public helayers::Saveable#
Manages the filters and biases used by TTConvolutionInterleaved.
Public Functions
-
inline TTConvFilters(const HeContext &he)#
Constructs an empty TTConvFilters object.
- Parameters:
he – HeContext
-
TTConvFilters(const TTConvConfig &_config, const DoubleTensor *plainFilters = nullptr, const DoubleTensor *plainBiases = nullptr)#
Construct a new TTConvFilters object.
- Parameters:
_config – The convolution configuration object.
plainFilters – Filters (optional)
plainBiases – Biases (optional)
-
inline bool hasFilters() const#
Returns true if there are filters.
-
bool requiresMultiplication(const TTShape &in) const#
Returns true if the convolution involves multiplication (either by filters and/or masks)
- Parameters:
in – Input shape
-
inline bool hasBiases() const#
Returns true if there are biases.
-
inline const TileTensor &getBiases() const#
Returns the biases.
-
inline int getFiltersChainIndex() const#
Returns the chain index of the filters.
-
TensorIterator getFiltersExternalIterator(const TensorIterator &inputExtIterator) const#
Returns the external iterator of the filters that matches current location in the input image.
- Parameters:
inputExtIterator – The current input external iterator
-
const Tile *getMaskedFilterTile(bool &skip, bool &deleteTile, int inputChainIndex, int flatIndex, const TTInterleavedTileMask &maskGenerator, int rowOffset, int colOffset, bool needMasks, int outputTileFlatIndex) const#
Returns a masked filter tile or nullptr if none.
- Parameters:
skip – Output argument: Whether the input tile can be skipped because the filter tile is entirely zeros
deleteTile – Output argument: Whether the returned pointer should be deleted.
inputChainIndex – Chain index of input tile
flatIndex – Flat index to filters tile tensors
maskGenerator – Mask generator
rowOffset – Filter offset from pivot
colOffset – Filter offset from pivot
needMasks – Whether masks are required
outputTileFlatIndex – Flat index to output tile
- Returns:
-
inline const TTConvConfig &getConfig() const#
Returns the configuration object.
-
virtual void saveImpl(std::ostream &stream) const override#
Saves the content of this object to the given stream.
- Parameters:
stream – The stream to save to.
-
virtual void loadImpl(std::istream &stream) override#
Loads the content of this object from the given stream.
- Parameters:
stream – The stream to load from.
-
virtual void debugPrint(const std::string &title = "", Verbosity verbosity = VERBOSITY_REGULAR, std::ostream &out = std::cout) const override#
Prints the content of this object.
- Parameters:
title – Text to add to the print
verbosity – Verbosity level
out – Output stream
-
void wakeup()#
Wakeup filters and biases tile tensors (in lazy mode)
-
void sleep()#
Sleep filters and biases tile tensors (in lazy mode)
-
inline std::shared_ptr<const TileTensor> getFiltersTileTensor() const#
Returns filters tile tensor.
-
inline std::shared_ptr<const TileTensor> getBiasesTileTensor() const#
Returns biases tile tensor.
-
void initCache() const#
Initialize cache for encode-on-the fly mode.
-
void clearCache() const#
Clear cache for encode-on-the fly mode.
-
inline TTConvFilters(const HeContext &he)#