6 #include <ATen/core/functional.h> 7 #include <ATen/TensorGeometry.h> 9 #include "torch/csrc/THP_export.h" 10 #include "torch/csrc/autograd/function.h" 11 #include "torch/csrc/autograd/variable.h" 12 #include "torch/csrc/autograd/saved_variable.h" 14 namespace torch {
namespace autograd {
namespace generated {
28 return fmap(xs, [](
const SavedVariable& x) {
29 return static_cast<Tensor>(x.unpack());
37 : sizes(t.sizes().vec())
40 Tensor zeros() {
return at::zeros(sizes, *type); }
43 std::vector<int64_t> sizes;
47 ${autograd_function_declarations}
Scalar represents a 0-dimensional tensor which contains a single element.