#include "torch/csrc/jit/symbolic_variable.h"
#include "torch/csrc/jit/tracer.h"
#include "torch/csrc/utils/hash.h"
-#include "torch/csrc/variable_tensor_functions.h"
#include "torch/csrc/autograd/generated/variable_factories.h"
#include "torch/csrc/autograd/engine.h"
#include "torch/csrc/jit/interned_strings.h"
#include "torch/csrc/utils/functional.h"
-#include "torch/csrc/variable_tensor_functions.h"
#include "torch/csrc/autograd/generated/variable_factories.h"
#include <ATen/ATen.h>
${TORCH_SRC_DIR}/csrc/jit/script/module.cpp
${TORCH_SRC_DIR}/csrc/jit/tracer.cpp
${TORCH_SRC_DIR}/csrc/jit/hooks_for_testing.cpp
- ${TORCH_SRC_DIR}/csrc/torch.cpp
${TORCH_SRC_DIR}/csrc/utils/tensor_flatten.cpp
${TORCH_SRC_DIR}/csrc/utils/variadic.cpp
${TORCH_ROOT}/test/cpp/jit/no-gtest.cpp
std::move(chunk_desc),
std::move(concat_desc),
has_random) {
- auto& config = getConfig();
TempFile so_file(so_template, 3);
TempFile cpp_file(cpp_template, 4);
cpp_file.write(code_);
#include <torch/csrc/jit/ivalue.h>
#include <torch/csrc/jit/constants.h>
#include <torch/csrc/jit/operator.h>
-#include <torch/csrc/variable_tensor_functions.h>
#include <torch/csrc/jit/script/jit_exception.h>
#include <exception>
#include <torch/csrc/jit/ir.h>
#include <torch/csrc/jit/pybind_utils.h>
-#include <torch/csrc/variable_tensor_functions.h>
-
#include <typeinfo>
#include <torch/csrc/autograd/python_engine.h>
#include <torch/csrc/jit/operator.h>
#include <torch/csrc/jit/custom_operator.h>
#include <torch/csrc/jit/script/jit_exception.h>
-#include <torch/csrc/variable_tensor_functions.h>
#include <ATen/ExpandUtils.h>
#include <ATen/WrapDimUtils.h>
#include <torch/csrc/autograd/engine.h>
#include <torch/csrc/jit/passes/dead_code_elimination.h>
#include <torch/csrc/jit/passes/remove_expands.h>
-#include <torch/csrc/variable_tensor_functions.h>
#include <string>
#include <sstream>
#include <torch/csrc/utils/python_strings.h>
#include <torch/csrc/utils/tensor_new.h>
#include <torch/csrc/utils/tensor_types.h>
-#include <torch/csrc/variable_tensor_functions.h>
#include <ATen/ATen.h>
py_bind_tensor_types(tensor_types);
// Use torch.float32 as the default tensor type
- set_default_tensor_type(torch::CPU(kFloat));
+ set_default_tensor_type(at::globalContext().getVariableType(at::Backend::CPU, at::kFloat));
}
static void py_bind_tensor_types(const std::vector<PyTensorType>& tensor_types) {
+++ /dev/null
-#include <torch/csrc/variable_tensor_functions.h>
-#include <torch/csrc/autograd/generated/VariableType.h>
-#include <torch/csrc/autograd/variable.h>
-
-namespace torch {
-at::TypeExtendedInterface& getVariableType(at::Backend backend, at::ScalarType type) {
- return *autograd::VariableType::getVariableTypeFromBaseType(at::getNonVariableType(backend, type));
-}
-
-at::TypeExtendedInterface& CPU(at::ScalarType type) {
- return torch::getVariableType(at::Backend::CPU, type);
-}
-
-at::TypeExtendedInterface& CUDA(at::ScalarType type) {
- return torch::getVariableType(at::Backend::CUDA, type);
-}
-
-at::Tensor toTensor(const at::Scalar& scalar) {
- return autograd::make_variable(scalar_to_tensor(scalar));
-}
-
-void set_requires_grad(at::Tensor& tensor, bool requires_grad) noexcept {
- autograd::as_variable_ref(tensor).set_requires_grad(requires_grad);
-}
-
-bool requires_grad(const at::Tensor& tensor) noexcept {
- return autograd::as_variable_ref(tensor).requires_grad();
-}
-} // namespace torch
+++ /dev/null
-#pragma once
-
-#include <ATen/ATen.h>
-#include <ATen/core/Deprecated.h>
-#include <torch/csrc/THP_export.h>
-
-namespace torch {
-
-// NOTE: This API is currently highly experimental and may change drastically
-// in the near future.
-
-// These functions provide a small wrapper around aten ensuring
-// that we create tensors with type Variable rather than raw tensors
-// when we create new tensors. We also provide a few accessors like
-// requires_grad that make it easier to get to varible information when we have
-// a at::Tensor
-
-/// Returns a `TypeExtendedInterface` object for the given backend (e.g.
-/// `at::kCPU`) and `ScalarType` (e.g. `at::kDouble`).
-/// TODO: Eliminate this function as much as possible
-AT_DEPRECATED(THP_CLASS at::TypeExtendedInterface& getVariableType(
- at::Backend backend,
- at::ScalarType type));
-
-/// Returns a `TypeExtendedInterface` object for the CPU backend and the given
-/// `ScalarType` (e.g. `at::kDouble`). Equivalent to `getVariableType(kCPU,
-/// type)`.
-/// TODO: Eliminate this function as much as possible
-AT_DEPRECATED(THP_CLASS at::TypeExtendedInterface& CPU(at::ScalarType type));
-
-/// Returns a `TypeExtendedInterface` object for the CUDA backend and the given
-/// `ScalarType` (e.g. `at::kDouble`). Equivalent to `getVariableType(kCUDA,
-/// type)`.
-/// TODO: Eliminate this function as much as possible
-AT_DEPRECATED(THP_CLASS at::TypeExtendedInterface& CUDA(at::ScalarType type));
-
-/// Sets the `requires_grad` property of the given `Tensor`.
-AT_DEPRECATED(THP_CLASS void set_requires_grad(
- at::Tensor& tensor,
- bool requires_grad) noexcept);
-
-/// Returns the `requires_grad` of the given `Tensor`.
-AT_DEPRECATED(THP_CLASS bool requires_grad(const at::Tensor& tensor) noexcept);
-
-} // namespace torch
#include <torch/all.h>
// Python bindings for the C++ frontend (includes Python.h).
#include <torch/python.h>
-// Deprecated tensor factories (to be removed).
-#include <torch/csrc/variable_tensor_functions.h>