Blob class refers to a blob of memory in device or host.
Usually a Blob is constructed by specifying the blob size and device, memory allocation happens during the Blob's construction.
A Blob's buffer can also be managed by an external memory manager. In this case, a deleter function is needed to notify the external memory manager that the memory is no longer needed. It does not make sense to infer the total buffer size. For example, if a Tensor has a negative stride size, it is necessary to access memory addresses smaller than Blob's beginning memory address. The only responsibility for Blob is to hold the beginning memory address and it's up to the user to access any addresses around it.
In summary:
- A Blob does not know about its memory size after construction.
- A Blob cannot be deep-copied. However, the Tensor which owns the blob can be copied.