@@ -63,7 +63,7 @@ fn arange[
6363 )
6464 for idx in range (num):
6565 result.data[idx] = (
66- start.cast[dtype]() + step.cast[dtype]() * idx
66+ start + step * idx
6767 )
6868
6969 return result
@@ -113,11 +113,11 @@ fn linspace[
113113 constrained[not dtype.is_integral()]()
114114 if parallel:
115115 return _linspace_parallel[dtype](
116- start.cast[dtype]() , stop.cast[dtype]() , num, endpoint
116+ start, stop, num, endpoint
117117 )
118118 else :
119119 return _linspace_serial[dtype](
120- start.cast[dtype]() , stop.cast[dtype]() , num, endpoint
120+ start, stop, num, endpoint
121121 )
122122
123123
@@ -245,18 +245,18 @@ fn logspace[
245245 # )
246246 if parallel:
247247 return _logspace_parallel[dtype](
248- start.cast[dtype]() ,
249- stop.cast[dtype]() ,
248+ start,
249+ stop,
250250 num,
251- base.cast[dtype]() ,
251+ base,
252252 endpoint,
253253 )
254254 else :
255255 return _logspace_serial[dtype](
256- start.cast[dtype]() ,
257- stop.cast[dtype]() ,
256+ start,
257+ stop,
258258 num,
259- base.cast[dtype]() ,
259+ base,
260260 endpoint,
261261 )
262262
@@ -382,22 +382,22 @@ fn geomspace[
382382 # "Both input and output datatypes cannot be integers. If the input is a float, the output must also be a float."
383383 # )
384384
385- var a : Scalar[dtype] = start.cast[dtype]()
385+ var a : Scalar[dtype] = start
386386
387387 if endpoint:
388388 var result : NDArray[dtype] = NDArray[dtype](NDArrayShape(num))
389389 var r : Scalar[dtype] = (
390- stop.cast[dtype]() / start.cast[dtype]()
391- ) ** (1 / (num - 1 )).cast[dtype]()
390+ stop / start
391+ ) ** (1 / (num - 1 ))
392392 for i in range (num):
393393 result.data[i] = a * r** i
394394 return result
395395
396396 else :
397397 var result : NDArray[dtype] = NDArray[dtype](NDArrayShape(num))
398398 var r : Scalar[dtype] = (
399- stop.cast[dtype]() / start.cast[dtype]()
400- ) ** (1 / (num)).cast[dtype]()
399+ stop / start
400+ ) ** (1 / (num))
401401 for i in range (num):
402402 result.data[i] = a * r** i
403403 return result
@@ -537,7 +537,7 @@ fn full[
537537 Returns:
538538 A NDArray of `dtype` with given `shape`.
539539 """
540- var tens_value : SIMD [dtype, 1 ] = SIMD [dtype, 1 ](fill_value).cast[dtype]()
540+ var tens_value : SIMD [dtype, 1 ] = SIMD [dtype, 1 ](fill_value)
541541 return NDArray[dtype](shape, fill = tens_value)
542542
543543
0 commit comments