pytorch/torch/csrc/utils/tensor_new.h
Roy Li d70c6f23f4 Pass ScalarType separately from Type in python constructors
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17786

Reviewed By: ezyang

Differential Revision: D14379075

fbshipit-source-id: 3abf066563b789a30cafe5b0c868a41326f5b833
2019-04-04 02:24:20 -07:00

26 lines
1.4 KiB
C++

#pragma once
#include <torch/csrc/python_headers.h>
#include <ATen/ATen.h>
namespace torch { namespace utils {
at::Tensor legacy_tensor_ctor(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor legacy_tensor_new(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor indexing_tensor_from_data(
const at::Type& type,
at::ScalarType scalar_type,
c10::optional<at::Device> device,
PyObject* data);
at::Tensor sparse_coo_tensor_ctor(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor tensor_ctor(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor as_tensor(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor new_tensor(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor new_empty(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor new_full(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor new_ones(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
at::Tensor new_zeros(const at::Type& type, at::ScalarType scalar_type, PyObject* args, PyObject* kwargs);
}} // namespace torch::utils