mirror of https://github.com/Jittor/Jittor
bool slice check
This commit is contained in:
parent
6b9bfef1da
commit
0d94663dee
|
@ -8,7 +8,7 @@
|
|||
# This file is subject to the terms and conditions defined in
|
||||
# file 'LICENSE.txt', which is part of this source code package.
|
||||
# ***************************************************************
|
||||
__version__ = '1.2.2.35'
|
||||
__version__ = '1.2.2.36'
|
||||
from . import lock
|
||||
with lock.lock_scope():
|
||||
ori_int = int
|
||||
|
|
|
@ -745,7 +745,9 @@ void load_var_slice(PyObject* obj, T* var_slice, vector<unique_ptr<VarHolder>>&
|
|||
} else {
|
||||
holders.emplace_back();
|
||||
auto* vh = from_py_object<VarHolder*>(obj, holders.back());
|
||||
auto vv = (Var**)vh;
|
||||
auto vv = (decltype(var_slice->var)*)vh;
|
||||
CHECK(vv[0]->dtype() != ns_bool) << "Please convert bool slice into jt.array, example:\n"
|
||||
"a[[True,False,False]] ---> a[jt.array([True,False,False])";
|
||||
var_slice->set_var(vv[0]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
#include "common.h"
|
||||
#include "misc/nano_vector.h"
|
||||
#include "var.h"
|
||||
|
||||
namespace jittor {
|
||||
|
||||
|
|
Loading…
Reference in New Issue