MCPcopy Create free account
hub / github.com/apache/singa / RepeatData

Method RepeatData

src/core/tensor/tensor.cc:292–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void Tensor::RepeatData(const vector<size_t> &repeats, int axis,
293 int total_repeats, const Tensor &src) {
294 if (repeats.size() == 1) {
295 CHECK_EQ(Size(), src.Size() * total_repeats);
296 } else {
297 CHECK_EQ(Size(), src.Size() * total_repeats / src.shape()[axis]);
298 }
299
300 CHECK(block_ != nullptr);
301 // Do repeat only if the src's block is already initialized.
302 if (src.block_ != nullptr) {
303 singa::RepeatDataToFrom(false, repeats, axis, this, src, Size());
304 }
305}
306
307void Tensor::FromProto(const singa::TensorProto &proto) {
308 if (block_ != nullptr && block_->DecRefCount() == 0)

Callers 2

TESTFunction · 0.80
RepeatMethod · 0.80

Calls 4

RepeatDataToFromFunction · 0.85
shapeMethod · 0.80
sizeMethod · 0.45
SizeMethod · 0.45

Tested by 1

TESTFunction · 0.64