Files
pytorch/torch/csrc/autograd/python_variable_indexing.h
anjali411 37e0d2e361 Fix segfault while real and imaginary attributes are set to a number (#73867)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73867

Fixes https://github.com/pytorch/pytorch/issues/72947

Test Plan: Imported from OSS

Reviewed By: davidberard98

Differential Revision: D34695956

Pulled By: anjali411

fbshipit-source-id: 2f3eda272a5214335eae506bd387ce8da4d81b8c
(cherry picked from commit fdb07354cac22c30aa047e65fbac9840608db811)
2022-03-08 18:58:26 +00:00

15 lines
458 B
C++

#pragma once
#include <torch/csrc/python_headers.h>
#include <torch/csrc/autograd/python_variable.h>
namespace torch { namespace autograd {
Py_ssize_t THPVariable_length(PyObject* self);
PyObject* THPVariable_getitem(PyObject* self, PyObject* index);
int THPVariable_setitem(PyObject* self, PyObject* index, PyObject* value);
Variable valueToTensor(c10::TensorOptions options, PyObject* value, const at::Device& device);
}} // namespace torch::autograd