@@ -394,22 +394,22 @@ void pybind_core_tensor_definitions(py::module& m) {
394
394
},
395
395
" Create a 1D tensor with evenly spaced values in the given "
396
396
" interval." ,
397
- " stop" _a, " dtype" _a = py::none (), " device" _a = py::none ());
397
+ " stop" _a, py::pos_only (), py::kw_only (), " dtype" _a = py::none (),
398
+ " device" _a = py::none ());
398
399
tensor.def_static (
399
400
" arange" ,
400
- [](utility::optional< int64_t > start, int64_t stop,
401
- utility::optional<int64_t > step, utility::optional< Dtype> dtype,
401
+ [](int64_t start, int64_t stop, utility::optional< int64_t > step ,
402
+ utility::optional<Dtype> dtype,
402
403
utility::optional<Device> device) {
403
404
return Tensor::Arange (
404
- start.has_value () ? start.value () : 0 , stop,
405
- step.has_value () ? step.value () : 1 ,
405
+ start, stop, step.has_value () ? step.value () : 1 ,
406
406
dtype.has_value () ? dtype.value () : core::Int64,
407
407
device.has_value () ? device.value () : Device (" CPU:0" ));
408
408
},
409
409
" Create a 1D tensor with evenly spaced values in the given "
410
410
" interval." ,
411
- " start" _a = py::none (), " stop " _a, " step " _a = py::none (),
412
- " dtype " _a = py::none (), " device" _a = py::none ());
411
+ " start" _a, " stop " _a, " step " _a = py::none (), " dtype " _a = py::none (),
412
+ py::kw_only (), " device" _a = py::none ());
413
413
414
414
// Tensor creation from arange for float.
415
415
tensor.def_static (
@@ -423,22 +423,22 @@ void pybind_core_tensor_definitions(py::module& m) {
423
423
},
424
424
" Create a 1D tensor with evenly spaced values in the given "
425
425
" interval." ,
426
- " stop" _a, " dtype" _a = py::none (), " device" _a = py::none ());
426
+ " stop" _a, py::pos_only (), py::kw_only (), " dtype" _a = py::none (),
427
+ " device" _a = py::none ());
427
428
tensor.def_static (
428
429
" arange" ,
429
- [](utility::optional< double > start, double stop,
430
- utility::optional<double > step, utility::optional< Dtype> dtype,
430
+ [](double start, double stop, utility::optional< double > step ,
431
+ utility::optional<Dtype> dtype,
431
432
utility::optional<Device> device) {
432
433
return Tensor::Arange (
433
- start.has_value () ? start.value () : 0.0 , stop,
434
- step.has_value () ? step.value () : 1.0 ,
434
+ start, stop, step.has_value () ? step.value () : 1.0 ,
435
435
dtype.has_value () ? dtype.value () : core::Float64 ,
436
436
device.has_value () ? device.value () : Device (" CPU:0" ));
437
437
},
438
438
" Create a 1D tensor with evenly spaced values in the given "
439
439
" interval." ,
440
- " start" _a = py::none (), " stop " _a, " step " _a = py::none (),
441
- " dtype " _a = py::none (), " device" _a = py::none ());
440
+ " start" _a, " stop " _a, " step " _a = py::none (), " dtype " _a = py::none (),
441
+ py::kw_only (), " device" _a = py::none ());
442
442
443
443
tensor.def (
444
444
" append" ,
0 commit comments