[Mlir-commits] [mlir] [mlir][sparse] minor edits to support lib files (PR #68137)

Peiming Liu llvmlistbot at llvm.org
Tue Oct 3 10:59:25 PDT 2023


================
@@ -89,27 +81,13 @@ class SparseTensorCOO final {
   using size_type = typename vector_type::size_type;
 
   /// Constructs a new coordinate-scheme sparse tensor with the given
-  /// sizes and initial storage capacity.
-  ///
-  /// Asserts:
-  /// * `dimSizes` has nonzero size.
-  /// * the elements of `dimSizes` are nonzero.
+  /// sizes and an optional initial storage capacity.
   explicit SparseTensorCOO(const std::vector<uint64_t> &dimSizes,
                            uint64_t capacity = 0)
       : SparseTensorCOO(dimSizes.size(), dimSizes.data(), capacity) {}
 
-  // TODO: make a class for capturing known-valid sizes (a la PermutationRef),
-  // so that `SparseTensorStorage::toCOO` can avoid redoing these assertions.
-  // Also so that we can enforce the asserts *before* copying into `dimSizes`.
-  //
   /// Constructs a new coordinate-scheme sparse tensor with the given
-  /// sizes and initial storage capacity.
-  ///
-  /// Precondition: `dimSizes` must be valid for `dimRank`.
-  ///
-  /// Asserts:
-  /// * `dimRank` is nonzero.
-  /// * the elements of `dimSizes` are nonzero.
+  /// sizes and an optional initial storage capacity.
----------------
PeimingLiu wrote:

Maybe add "the size of the range pointed by dimSizes is determined by dimRank"?

https://github.com/llvm/llvm-project/pull/68137


More information about the Mlir-commits mailing list