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

Function CopyRows

src/core/tensor/tensor.cc:1410–1419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1408}
1409
1410Tensor CopyRows(const Tensor &in, const size_t start, const size_t end) {
1411 CHECK_LT(start, end);
1412 CHECK_GE(in.shape(0), end) << "Tensor size must >= end";
1413 Shape s = in.shape();
1414 s[0] = end - start;
1415 size_t sample_size = in.Size() / in.shape(0);
1416 Tensor out(s, in.device(), in.data_type());
1417 CopyDataToFrom(&out, in, out.Size(), 0, start * sample_size);
1418 return out;
1419}
1420
1421Tensor SliceOn(const Tensor &in, const size_t start, const size_t end,
1422 int axis) {

Callers 7

TEST_FFunction · 0.85
SliceRowsFunction · 0.85
TrainMethod · 0.85
EvaluateMethod · 0.85
PredictMethod · 0.85
ForwardMethod · 0.85
BackwardMethod · 0.85

Calls 5

CopyDataToFromFunction · 0.85
shapeMethod · 0.80
deviceMethod · 0.80
data_typeMethod · 0.80
SizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.68