29 std::transform(in, in + num_elements, out, [](FromT a) {
return static_cast<ToT
>(a); });
55 switch (Tensor::element_type(kernel.
input()))
58 case DataType::FLOAT32:
60 const float *input_data_float = kernels::getTensorData<float>(input_data);
62 switch (Tensor::element_type(kernel.
output()))
65 copyCast(input_data_float, kernels::getTensorData<int8_t>(output_data), flat_size);
68 copyCast(input_data_float, kernels::getTensorData<int16_t>(output_data), flat_size);
71 copyCast(input_data_float, kernels::getTensorData<int32_t>(output_data), flat_size);
74 assert(
false &&
"Not supported type");
80 assert(
false &&
"Unsupported type");