reid from https://github.com/michuanhaohao/reid-strong-baseline
zhangmeng
2020-01-17 f7c4a3cfd07adede3308f8d9d3d7315427d90a7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once
 
#include <ATen/Tensor.h>
#include <ATen/ATen.h>
#include <ATen/dlpack.h>
 
// this convertor will:
// 1) take a Tensor object and wrap it in the DLPack tensor
// 2) take a dlpack tensor and convert it to the ATen Tensor
 
namespace at {
 
CAFFE2_API ScalarType toScalarType(const DLDataType& dtype);
CAFFE2_API DLManagedTensor* toDLPack(const Tensor& src);
CAFFE2_API Tensor fromDLPack(const DLManagedTensor* src);
CAFFE2_API DLDataType getDLDataType(const Tensor& t);
CAFFE2_API DLContext getDLContext(const Tensor& tensor, const int64_t& device_id);
 
} //namespace at