elem_t limits[2] = {std::numeric_limits<elem_t>::min(), \
std::numeric_limits<elem_t>::max()}; \
calc_t c_scale = static_cast<calc_t>(scale); \
calc_t c_offset =
static_cast<calc_t
>(
offset); \
DISPATCH_DTYPE_TO_TEMPLATE(src.GetDtype(), [&]() { \
core::ParallelFor( \
src.GetDevice(), indexer.NumWorkloads(), \
[=] OPEN3D_DEVICE(int64_t workload_idx) { \
auto src_ptr = \
indexer.GetInputPtr<scalar_t>(0, workload_idx); \
auto dst_ptr = indexer.GetOutputPtr<elem_t>(workload_idx); \
calc_t out = static_cast<calc_t>(*src_ptr) * c_scale + \
c_offset; \
out = out < limits[0] ? limits[0] : out; \
out = out > limits[1] ? limits[1] : out; \
*dst_ptr = static_cast<elem_t>(out); \
}); \
});