Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove compilation warning #39438

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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