Commit 23fdcd0e authored by wooway777's avatar wooway777
Browse files

issue/27 - fixed slicing for req offset

parent c6512611
...@@ -282,8 +282,8 @@ void inferDeviceBatch(const JiugeMeta &meta, DeviceResource &rsrc, ...@@ -282,8 +282,8 @@ void inferDeviceBatch(const JiugeMeta &meta, DeviceResource &rsrc,
for (uint32_t req = 0; req < nreq; req++) { for (uint32_t req = 0; req < nreq; req++) {
auto seq_len = req_lens[req]; auto seq_len = req_lens[req];
float random_val = std::uniform_real_distribution<float>(0, 1)(gen); float random_val = std::uniform_real_distribution<float>(0, 1)(gen);
randomSample(result_buf->memShare({}, result_buf->dtype()), randomSample(result_buf->slice(0, req, 1)->view_as({}, {}),
prob_buf->view_as({dvoc}, {1}), prob_buf->slice(0, req, 1)->view_as({dvoc}, {1}),
random_val, topp[req], topk[req], temperature[req]); random_val, topp[req], topk[req], temperature[req]);
token_offset += seq_len; token_offset += seq_len;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment