mirror of https://github.com/google/gemma.cpp.git
Allow creating empty `AttentionActivations` for experimental code.
PiperOrigin-RevId: 772077675
This commit is contained in:
parent
6773e4517c
commit
5f3797f6e1
|
|
@ -98,7 +98,10 @@ struct AttentionActivations {
|
||||||
|
|
||||||
div_seq_len(static_cast<uint32_t>(seq_len)),
|
div_seq_len(static_cast<uint32_t>(seq_len)),
|
||||||
query_scale(ChooseQueryScale(config)) {
|
query_scale(ChooseQueryScale(config)) {
|
||||||
HWY_ASSERT(batch_size != 0);
|
if (batch_size == 0) {
|
||||||
|
HWY_WARN("Creating mostly empty activations with a batch_size of 0.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// For MatMul outputs, precompute their row pointers.
|
// For MatMul outputs, precompute their row pointers.
|
||||||
// If we forget any MatMul outputs here, debug builds print a warning but
|
// If we forget any MatMul outputs here, debug builds print a warning but
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue