Update Llama example to use the simplified transpose implementation and increase default profiler size to 1,000,000 events.

This commit is contained in:
Foke Singh 2023-12-15 12:06:42 +00:00
parent 145e60b4dd
commit 8a031bd4c8

View File

@ -194,7 +194,7 @@ pub const Llama = struct {
pub fn embed(embed_tokens_: zml.nn.TokenEmbedding, tokens_: Tensor, token_index: ?Tensor) Tensor {
const tokens = if (token_index) |idx|
tokens_.dynamicSlice1d(-1, 1, idx)
tokens_.dynamicSlice1d(-1, .{ .start = idx, .len = 1 })
else
tokens_;
return zml.call(embed_tokens_, .forward, .{tokens}).withPartialTags(.{ .s, .d });