提交 34262d90 编写于 作者: M Megvii Engine Team 提交者: huangxinda

fix(imperative): fix the size of blob with offset

GitOrigin-RevId: bb1736dfe11f0891834645461b15d5fb68b5a6fa
上级 787f187e
......@@ -583,7 +583,7 @@ def test_trace_advance_indexing(shape_mode):
inputs = {
"x": np.random.randn(5, 5, 5, 5, 5).astype("float32"),
"i": 0,
"i": 4,
"j": 2,
"start": 1,
"end": 3,
......
......@@ -232,7 +232,7 @@ namespace {
Blob::Blob(const DeviceTensorStorage& s):
m_comp_node{s.comp_node()}, m_storage{s.raw_storage()},
m_size{s.size()} {
m_size{s.size() + s.offset()} {
m_id = next_blob_id++;
BlobManager::inst()->register_blob(this);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册