Skip to content

Commit

Permalink
fix compilation warning on mac (#39438)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangkaihuo authored Feb 11, 2022
1 parent 667bd96 commit be8ab0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions paddle/pten/core/sparse_coo_tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SparseCooTensor : public TensorBase,

/// \brief Return the number of elements contained in original dense tensor
/// \return The number of elements contained in original dense tensor
int64_t numel() const { return product(dims_); }
int64_t numel() const override { return product(dims_); }

/// \brief Returns the dims of the original dense tensor.
/// \return The dims of the original dense tensor.
Expand All @@ -100,15 +100,15 @@ class SparseCooTensor : public TensorBase,

/// \brief Returns the data layout of the tensor.
/// \return The data layout of the tensor.
DataLayout layout() const { return DataLayout::SPARSE_COO; }
DataLayout layout() const noexcept override { return DataLayout::SPARSE_COO; }

/// \brief Returns the data place of the tensor.
/// \return The data place of the tensor.
const Place& place() const override { return non_zero_elements_.place(); }

/// \brief Test whether the non_zero_elements_ metadata is valid.
/// \return Whether the non_zero_elements_ metadata is valid.
bool valid() const noexcept { return non_zero_elements_.valid(); }
bool valid() const noexcept override { return non_zero_elements_.valid(); }

/// \brief Test whether the non_zero_elements_ storage is allocated.
/// return Whether the non_zero_elements_ storage is allocated.
Expand Down
6 changes: 3 additions & 3 deletions paddle/pten/core/sparse_csr_tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SparseCsrTensor : public TensorBase,

/// \brief Return the number of elements contained in original dense tensor
/// \return The number of elements contained in original dense tensor
int64_t numel() const { return product(dims_); }
int64_t numel() const override { return product(dims_); }

/// \brief Returns the dims of the original dense tensor.
/// \return The dims of the original dense tensor.
Expand All @@ -100,15 +100,15 @@ class SparseCsrTensor : public TensorBase,

/// \brief Returns the data layout of the tensor.
/// \return The data layout of the tensor.
DataLayout layout() const { return DataLayout::SPARSE_CSR; }
DataLayout layout() const noexcept override { return DataLayout::SPARSE_CSR; }

/// \brief Returns the data place of the tensor.
/// \return The data place of the tensor.
const Place& place() const override { return non_zero_elements_.place(); }

/// \brief Test whether the non_zero_elements_ metadata is valid.
/// \return Whether the non_zero_elements_ metadata is valid.
bool valid() const noexcept { return non_zero_elements_.valid(); }
bool valid() const noexcept override { return non_zero_elements_.valid(); }

/// \brief Test whether the non_zero_elements_ storage is allocated.
/// return Whether the non_zero_elements_ storage is allocated.
Expand Down

0 comments on commit be8ab0e

Please sign in to comment.