| 1397 | |
| 1398 | static byte_buf i64_to_i32(const st_value *src) { |
| 1399 | if (strcmp(src->dtype, "I64") != 0) die("expected I64 source for I32 tensor"); |
| 1400 | const int64_t n = value_nelements(src); |
| 1401 | if (src->nbytes != (size_t)n * sizeof(int64_t)) die("bad I64 byte size"); |
| 1402 | byte_buf out = { .size = (size_t)n * sizeof(int32_t), .data = xmalloc((size_t)n * sizeof(int32_t)) }; |
| 1403 | int32_t *dst = (int32_t *)out.data; |
| 1404 | for (int64_t i = 0; i < n; i++) { |
no outgoing calls
no test coverage detected