Caffe2 - C++ API
A deep learning, cross platform ML framework
dlconvertor_test.cpp
1 #include <gtest/gtest.h>
2 
3 #include <ATen/ATen.h>
4 #include <ATen/DLConvertor.h>
5 
6 #include <iostream>
7 #include <string.h>
8 #include <sstream>
9 
10 using namespace at;
11 TEST(TestDlconvertor, TestDlconvertor) {
12  manual_seed(123);
13 
14  Tensor a = rand({3, 4});
15  DLManagedTensor* dlMTensor = toDLPack(a);
16 
17  Tensor b = fromDLPack(dlMTensor);
18 
19  ASSERT_TRUE(a.equal(b));
20 }
C Tensor object, manage memory of DLTensor. This data structure is intended to faciliate the borrowin...
Definition: dlpack.h:125
Flush-To-Zero and Denormals-Are-Zero mode.