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

Function Tensors

cpp/src/arrow/ipc/generate_tensor_fuzz_corpus.cc:63–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63Result<std::vector<std::shared_ptr<Tensor>>> Tensors() {
64 std::vector<std::shared_ptr<Tensor>> tensors;
65 std::shared_ptr<Tensor> tensor;
66 std::vector<int64_t> shape = {5, 3, 7};
67 std::shared_ptr<DataType> types[] = {int8(), int16(), int32(), int64(),
68 uint8(), uint16(), uint32(), uint64()};
69 uint32_t seed = 0;
70 for (auto type : types) {
71 RETURN_NOT_OK(
72 test::MakeRandomTensor(type, shape, /*row_major_p=*/true, &tensor, seed++));
73 tensors.push_back(tensor);
74 RETURN_NOT_OK(
75 test::MakeRandomTensor(type, shape, /*row_major_p=*/false, &tensor, seed++));
76 tensors.push_back(tensor);
77 }
78 return tensors;
79}
80
81Status GenerateTensors(const PlatformFilename& dir_fn) {
82 int sample_num = 1;

Callers

nothing calls this directly

Calls 2

MakeRandomTensorFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected