/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
ATen
/
core
/
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/core
mkdir
upload
Name
Size
Mode
Actions
boxing/
-
0755
rm
dispatch/
-
0755
rm
op_registration/
-
0755
rm
alias_info.h
2986
0644
edit
dl
rm
Array.h
768
0644
edit
dl
rm
ATenGeneral.h
45
0644
edit
dl
rm
ATenOpList.h
246
0644
edit
dl
rm
aten_interned_strings.h
25389
0644
edit
dl
rm
Backtrace.h
59
0644
edit
dl
rm
blob.h
5422
0644
edit
dl
rm
builtin_function.h
3649
0644
edit
dl
rm
DeprecatedTypeProperties.h
3773
0644
edit
dl
rm
DeprecatedTypePropertiesRegistry.h
795
0644
edit
dl
rm
Dict.h
13195
0644
edit
dl
rm
Dict_inl.h
7996
0644
edit
dl
rm
Dimname.h
1188
0644
edit
dl
rm
DimVector.h
247
0644
edit
dl
rm
DistributionsHelper.h
12594
0644
edit
dl
rm
Formatting.h
959
0644
edit
dl
rm
function.h
2145
0644
edit
dl
rm
functional.h
1460
0644
edit
dl
rm
function_schema.h
13577
0644
edit
dl
rm
function_schema_inl.h
9319
0644
edit
dl
rm
Generator.h
4935
0644
edit
dl
rm
grad_mode.h
210
0644
edit
dl
rm
interned_strings.h
25332
0644
edit
dl
rm
interned_strings_class.h
770
0644
edit
dl
rm
ivalue.h
38823
0644
edit
dl
rm
ivalue_inl.h
59963
0644
edit
dl
rm
ivalue_to.h
756
0644
edit
dl
rm
jit_type.h
75971
0644
edit
dl
rm
jit_type_base.h
6508
0644
edit
dl
rm
LegacyTypeDispatch.h
4626
0644
edit
dl
rm
List.h
15667
0644
edit
dl
rm
List_inl.h
11012
0644
edit
dl
rm
Macros.h
44
0644
edit
dl
rm
MT19937RNGEngine.h
6410
0644
edit
dl
rm
NamedTensor.h
5050
0644
edit
dl
rm
operator_name.h
3018
0644
edit
dl
rm
PhiloxRNGEngine.h
6496
0644
edit
dl
rm
PythonModeTLS.h
403
0644
edit
dl
rm
qualified_name.h
4358
0644
edit
dl
rm
QuantizerBase.h
2443
0644
edit
dl
rm
Range.h
418
0644
edit
dl
rm
Reduction.h
461
0644
edit
dl
rm
rref_interface.h
1144
0644
edit
dl
rm
Scalar.h
29
0644
edit
dl
rm
ScalarType.h
33
0644
edit
dl
rm
stack.h
6034
0644
edit
dl
rm
Tensor.h
1756
0644
edit
dl
rm
TensorAccessor.h
10296
0644
edit
dl
rm
TensorBase.h
32767
0644
edit
dl
rm
TensorBody.h
247555
0644
edit
dl
rm
TransformationHelper.h
6911
0644
edit
dl
rm
typeid.h
29
0644
edit
dl
rm
UndefinedTensorImpl.h
42
0644
edit
dl
rm
UnsafeFromTH.h
708
0644
edit
dl
rm
VariableHooksInterface.h
3312
0644
edit
dl
rm
Variadic.h
2257
0644
edit
dl
rm
Vitals.h
2305
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/core/VariableHooksInterface.h
(3312B)
#pragma once #include <c10/macros/Export.h> #include <ATen/core/Tensor.h> // A little explanation about why this file exists at all. We have // a few methods on Tensor class which require access to reified access to // AutogradMeta. In open source, this isn't a big deal: we just access // torch/csrc/autograd/variable.h from aten/src/ATen/core/Tensor.cpp and // we can put the definitions inline. This is because everything gets balled // into a single dynamic library in the end. // // However, inside our Facebook internal version of our build system, we // have a split between aten and torch/csrc. So we cannot simply just // cross this boundary. "Now wait," you might say, "Why don't we just // merge the libraries inside Facebook". Well, the problem is that there // are some downstream applications which are at binary size limit, and // incorporating all of the extra code from libtorch would push them // over (admarket/adreview/service:adreviewservice, see also // https://github.com/pytorch/pytorch/pull/29299) So if you want to do that, // we have to fix all of the services like this. // // I didn't want to block eliminating Tensor-Variable on this work, so I // had to introduce another dynamic dispatch to get to the variable // implementations (which live in torch/csrc/autograd/variable.cpp, FYI). // // I also considered using our existing dynamic dispatch mechanism, c10 // dispatcher, to do this. However, (1) some of the functions on Tensor // have weird signatures that are not supported by autograd, and (2) // see this bug https://github.com/pytorch/pytorch/issues/30102 namespace torch { namespace autograd { struct Node; }} // namespace torch::autograd namespace at { namespace impl { struct TORCH_API VariableHooksInterface { virtual ~VariableHooksInterface() = default; virtual TensorBase tensor_data(const TensorBase&) const = 0; virtual TensorBase variable_data(const TensorBase&) const = 0; virtual const std::shared_ptr<torch::autograd::Node>& grad_fn(const TensorBase&) const = 0; virtual unsigned _register_hook( const TensorBase&, std::function<TensorBase(const TensorBase&)> hook) const = 0; virtual void remove_hook(const TensorBase&, unsigned pos) const = 0; virtual bool is_view(const TensorBase&) const = 0; virtual const TensorBase& base(const TensorBase&) const = 0; virtual const std::string& name(const TensorBase&) const = 0; virtual bool is_leaf(const TensorBase&) const = 0; virtual int64_t output_nr(const TensorBase&) const = 0; virtual void set_data(const TensorBase&, const TensorBase&) const = 0; virtual TensorBase data(const TensorBase&) const = 0; virtual int64_t _version(const TensorBase&) const = 0; virtual void retain_grad(const TensorBase&) const = 0; virtual bool retains_grad(const TensorBase&) const = 0; virtual void _backward(const Tensor&, TensorList, const c10::optional<Tensor>&, c10::optional<bool>, bool) const = 0; virtual void requires_grad_(const TensorBase&, bool) const = 0; }; TORCH_API void SetVariableHooks(VariableHooksInterface* hooks); TORCH_API VariableHooksInterface* GetVariableHooks(); struct TORCH_API VariableHooksRegisterer { explicit VariableHooksRegisterer(VariableHooksInterface* hooks) { SetVariableHooks(hooks); } }; }} // namespace at::impl
Save
cmd:
run