Skip to content

Commit

Permalink
Merge pull request tensor-compiler#343 from Infinoid/build-failure-py…
Browse files Browse the repository at this point in the history
…taco-clang10

Fix python bindings when building with clang++-10
  • Loading branch information
stephenchouca authored Dec 9, 2020
2 parents efa47b1 + 833e22f commit dd62216
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python_bindings/src/pyTensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static void declareTensor(py::module &m, const std::string typestr) {
return elementGetter<CType>(self, indices);
}, py::is_operator())

.def("__getitem__", [](typedTensor& self, nullptr_t ptr) -> Access{
.def("__getitem__", [](typedTensor& self, std::nullptr_t ptr) -> Access{
if(self.getOrder() != 0) {
throw py::index_error("Can only index scalar tensors with None.");
}
Expand All @@ -417,15 +417,15 @@ static void declareTensor(py::module &m, const std::string typestr) {
.def("__getitem__", &accessGetter<CType, std::vector<IndexVar>&>, py::is_operator())

// Set scalars to expression using none
.def("__setitem__", [](typedTensor& self, nullptr_t ptr, const IndexExpr expr) -> void {
.def("__setitem__", [](typedTensor& self, std::nullptr_t ptr, const IndexExpr expr) -> void {
self = expr;
}, py::is_operator())

.def("__setitem__", [](typedTensor& self, nullptr_t ptr, const Access access) -> void {
.def("__setitem__", [](typedTensor& self, std::nullptr_t ptr, const Access access) -> void {
self = access;
}, py::is_operator())

.def("__setitem__", [](typedTensor& self, nullptr_t ptr, const TensorVar tensorVar) -> void {
.def("__setitem__", [](typedTensor& self, std::nullptr_t ptr, const TensorVar tensorVar) -> void {
self = tensorVar;
}, py::is_operator())

Expand Down

0 comments on commit dd62216

Please sign in to comment.