Dayuxiaoshui opened a new pull request, #18492: URL: https://github.com/apache/tvm/pull/18492
This commit fixes issue #18474 by adding support for sparse tensor conversion in the PyTorch ExportedProgram importer. The fix automatically detects sparse tensors (non-strided layout) and converts them to dense tensors before DLPack conversion. Changes: - Add _convert_pytorch_tensor_to_tvm() static method to handle sparse tensor detection and conversion - Automatically convert sparse tensors to dense using .to_dense() before DLPack conversion - Update parameter/buffer/constant binding to use the new conversion method - Update parameter handling to use the new conversion method The fix ensures that PyTorch models containing sparse tensors can be successfully converted to TVM Relax modules without raising BufferError. Fixes #18474 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
