llama_batch_init method

llama_batch llama_batch_init(
  1. int n_tokens,
  2. int embd,
  3. int n_seq_max
)

Allocates a batch of tokens on the heap that can hold a maximum of n_tokens Each token can be assigned up to n_seq_max sequence ids The batch has to be freed with llama_batch_free() If embd != 0, llama_batch.embd will be allocated with size of n_tokens * embd * sizeof(float) Otherwise, llama_batch.token will be allocated to store n_tokens llama_token The rest of the llama_batch members are allocated with size n_tokens All members are left uninitialized

Implementation

llama_batch llama_batch_init(
  int n_tokens,
  int embd,
  int n_seq_max,
) {
  return _llama_batch_init(
    n_tokens,
    embd,
    n_seq_max,
  );
}