Support uninitialized tensors in file IO reads#1187
Conversation
bc496a8 to
061a97e
Compare
Greptile SummaryThis PR enables file IO read functions (
Confidence Score: 4/5Safe to merge for the common dynamic-tensor path, but adding IsInitialized() to the shared tensor_impl base class introduces a compile error for any caller that uses static tensors with file IO. The allocation and copy logic in NumpyToTensorView is correct for dynamic tensors (the only type tested). However, because IsInitialized() now lives on the tensor_impl base class, the has_is_initialized_v guard evaluates true for every tensor type. The compiler is then required to instantiate make_tensor(ten, shape) for non-dynamic types inside the non-constexpr if body, and no matching overload exists for those types. include/matx/core/pybind.h — the auto-allocation guard needs is_dynamic_tensor_v added alongside has_is_initialized_v. Important Files Changed
Reviews (5): Last reviewed commit: "Support uninitialized tensors in file IO..." | Re-trigger Greptile |
5a4b775 to
589b922
Compare
|
@greptile review |
|
/build |
589b922 to
64dd792
Compare
|
/build |
Add IsInitialized helpers to tensor types so callers do not inspect Data() directly. Allocate destination tensors during NumPy-backed file reads when the tensor has no data pointer, using the shape discovered from the file before copying data. Document CSV, MAT, and NPY IO examples, and clarify that MAT helpers operate on MAT-file variables rather than providing a general HDF5 interface. Add CSV, MAT, NPY, and tensor initialization regression coverage.
64dd792 to
c30d2e3
Compare
Allocate destination tensors during NumPy-backed file reads when the tensor has no data pointer, using the shape discovered from the file before copying data.
Add CSV, MAT, and NPY regression coverage for reading into default-constructed tensors.
Closes #816