Beispiel #1
0
torch::Data File::GetBytes(const std::string &path, size_t length)
{
    bool ok = true;
    
    // read data from disk
    File fstream;
    ok = fstream.Open(path, "rb");
    if (!ok) {
        return Data::Null;
    }
    
    Data buffer = fstream.GetBytes(length);
    fstream.Close();

    return std::move(buffer);
}