I'd prefer it if both classes could offer the same interface instead, so the caller does not need to distinguish between them. What do you think about having different classes for `X` (sparse/not sparse) and letting the weight layer choose what to do with it?