Converts an input value to a scalar if its type is a numpy or cupy
array, otherwise it returns the value as it is.
if type(value) == cupy.core.core.ndarray:
value = cuda.to_cpu(value)
if type(value) == numpy.array:
return numpy.asscalar(value)
After Change
Converts an input value to a scalar if its type is a numpy or cupy
array, otherwise it returns the value as it is.
if numpy.isscalar(value):
return value
if type(value) is not numpy.array:
value = cuda.to_cpu(value)