Browse Source

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

GitOrigin-RevId: bb1736dfe1
release-1.5
Megvii Engine Team huangxinda 4 years ago
parent
commit
34262d904c
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      imperative/python/test/unit/jit/test_tracing.py
  2. +1
    -1
      imperative/src/impl/physical_tensor.cpp

+ 1
- 1
imperative/python/test/unit/jit/test_tracing.py View File

@@ -583,7 +583,7 @@ def test_trace_advance_indexing(shape_mode):


inputs = { inputs = {
"x": np.random.randn(5, 5, 5, 5, 5).astype("float32"), "x": np.random.randn(5, 5, 5, 5, 5).astype("float32"),
"i": 0,
"i": 4,
"j": 2, "j": 2,
"start": 1, "start": 1,
"end": 3, "end": 3,


+ 1
- 1
imperative/src/impl/physical_tensor.cpp View File

@@ -232,7 +232,7 @@ namespace {


Blob::Blob(const DeviceTensorStorage& s): Blob::Blob(const DeviceTensorStorage& s):
m_comp_node{s.comp_node()}, m_storage{s.raw_storage()}, 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++; m_id = next_blob_id++;
BlobManager::inst()->register_blob(this); BlobManager::inst()->register_blob(this);
} }


Loading…
Cancel
Save