xref: /aosp_15_r20/external/pytorch/torch/README.txt (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1*da0073e9SAndroid Build Coastguard WorkerNote [TH abstraction violation]
2*da0073e9SAndroid Build Coastguard Worker~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3*da0073e9SAndroid Build Coastguard Worker
4*da0073e9SAndroid Build Coastguard WorkerTH/THC provide some hpp headers, which are proper C++ headers rather than
5*da0073e9SAndroid Build Coastguard WorkerC headers.  These headers serve double duty as *internal implementation
6*da0073e9SAndroid Build Coastguard Workerdetail* headers, whose contents should largely not be used by external
7*da0073e9SAndroid Build Coastguard Workerclients.
8*da0073e9SAndroid Build Coastguard Worker
9*da0073e9SAndroid Build Coastguard WorkerIdeally, we would not install these headers at all; instead, you should
10*da0073e9SAndroid Build Coastguard Workeruse public functions (in headers like `THTensor.h`, NOT `THTensor.hpp`)
11*da0073e9SAndroid Build Coastguard Workerto manipulate these structs.  However, there are a few places
12*da0073e9SAndroid Build Coastguard Workerin torch/csrc where we violate this abstraction.  They are marked with
13*da0073e9SAndroid Build Coastguard Workera pointer to this note.  Each of those sites will have to be refactored
14*da0073e9SAndroid Build Coastguard Workerwhen we refactor the guts of THTensor and related structures.
15