MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / NpyArray

Method NpyArray

examples/cpp/xlnet/cnpy.h:24–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23struct NpyArray {
24 NpyArray(const std::vector<size_t>& _shape, size_t _word_size, bool _fortran_order):
25 shape(_shape), word_size(_word_size), fortran_order(_fortran_order)
26 {
27 num_vals = 1;
28 for (size_t i = 0; i < shape.size(); i++)
29 num_vals *= shape[i];
30 data_holder = std::shared_ptr<std::vector<char>>(new std::vector<char>(num_vals * word_size));
31 }
32
33 NpyArray(): shape(0), word_size(0), fortran_order(0), num_vals(0) {}
34

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected