MCPcopy Create free account
hub / github.com/apache/arrow / SetUp

Method SetUp

cpp/src/arrow/sparse_tensor_test.cc:1435–1454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1433class TestSparseCSFTensorBase : public TestSparseTensorBase<Int16Type> {
1434 public:
1435 void SetUp() {
1436 dim_names_ = {"a", "b", "c", "d"};
1437 shape_ = {2, 3, 4, 5};
1438
1439 dense_values_[0][0][0][1] = 1;
1440 dense_values_[0][0][0][2] = 2;
1441 dense_values_[0][1][0][0] = 3;
1442 dense_values_[0][1][0][2] = 4;
1443 dense_values_[0][1][1][0] = 5;
1444 dense_values_[1][1][1][0] = 6;
1445 dense_values_[1][1][1][1] = 7;
1446 dense_values_[1][1][1][2] = 8;
1447
1448 auto dense_buffer = Buffer::Wrap(dense_values_, sizeof(dense_values_));
1449 Tensor dense_tensor_(int16(), dense_buffer, shape_, {}, dim_names_);
1450 ASSERT_OK_AND_ASSIGN(
1451 sparse_tensor_from_dense_,
1452 SparseCSFTensor::Make(dense_tensor_,
1453 TypeTraits<IndexValueType>::type_singleton()));
1454 }
1455
1456 protected:
1457 std::vector<int64_t> shape_;

Callers

nothing calls this directly

Calls 4

WrapFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.70
MakeFunction · 0.70
type_singletonFunction · 0.70

Tested by

no test coverage detected