Skip to content
Snippets Groups Projects
Commit 8254e91e authored by Maxence Naud's avatar Maxence Naud Committed by Olivier BICHLER
Browse files

make const value to const ref parameters

parent e4f6bc7e
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!188Fix CppCheck errors
......@@ -257,7 +257,7 @@ static void addScalarCtor(pyTensorClass& mTensor) {
// though it is not merged: https://github.com/pybind/pybind11/pull/3544/.
// Hence we use some helper functions defined above to try matching the different numpy scalar types.
mTensor.def(py::init([](py::object obj,
const std::string backend="cpu") {
const std::string& backend = "cpu") {
NativeValue native_val;
DataType native_dtype;
bool found = getScalarNativeVal(obj, &native_val, &native_dtype);
......@@ -283,7 +283,7 @@ static void addScalarCtor(pyTensorClass& mTensor) {
template<typename T>
void addArrayCtor(pyTensorClass& mTensor) {
mTensor.def(py::init([](const py::array_t<T, py::array::c_style|py::array::forcecast> b,
const std::string backend = "cpu") {
const std::string& backend = "cpu") {
/* Request a buffer descriptor from Python */
py::buffer_info info = b.request();
Tensor* newTensor = new Tensor();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment