|
|
|
@ -15,6 +15,7 @@ limitations under the License. */
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <utility>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
@ -46,11 +47,13 @@ class SelectedRows {
|
|
|
|
|
SelectedRows(const std::vector<int64_t>& rows, const int64_t& height)
|
|
|
|
|
: rows_(rows), height_(height) {
|
|
|
|
|
value_.reset(new Tensor());
|
|
|
|
|
auto_grown_mutex_.reset(new std::mutex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SelectedRows() {
|
|
|
|
|
height_ = 0;
|
|
|
|
|
value_.reset(new Tensor());
|
|
|
|
|
auto_grown_mutex_.reset(new std::mutex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
platform::Place place() const { return value_->place(); }
|
|
|
|
@ -125,7 +128,7 @@ class SelectedRows {
|
|
|
|
|
Vector<int64_t> rows_;
|
|
|
|
|
std::unique_ptr<Tensor> value_{nullptr};
|
|
|
|
|
int64_t height_;
|
|
|
|
|
std::mutex auto_grown_mutex_;
|
|
|
|
|
std::unique_ptr<std::mutex> auto_grown_mutex_{nullptr};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|