Moved Internal code around to simplify

PiperOrigin-RevId: 681877329
This commit is contained in:
Ray Smith 2024-10-03 07:54:21 -07:00 committed by Copybara-Service
parent 12291e1ac0
commit 895ee4c6ce
1 changed files with 4 additions and 2 deletions

View File

@ -167,7 +167,7 @@ struct CompressedLayerPointers {
c_vit_layers;
};
template <class TConfig, typename = void>
template <class TConfig>
struct CompressedWeights {
// Must be allocated via AllocateAligned and initialized with placement new.
void* operator new(size_t, void* addr) { return addr; }
@ -207,7 +207,9 @@ struct CompressedWeights {
// Must be last so that the other arrays remain aligned.
CompressedLayerPointers<TConfig> c_layer_ptrs;
explicit CompressedWeights(hwy::ThreadPool& pool) : c_layer_ptrs(pool) {}
explicit CompressedWeights(hwy::ThreadPool& pool)
: c_layer_ptrs(pool)
{}
// Called by weights.cc after ForEachTensor.
void Reshape(hwy::ThreadPool& pool) {