Update loader example to demonstrate handling of empty JSON arrays and improved torch loader readability

This commit is contained in:
Foke Singh 2023-03-22 14:52:33 +00:00
parent a4f0fc96c0
commit aae37738a5

View File

@ -60,7 +60,7 @@ pub fn asyncMain() !void {
while (it.next()) |entry| : (i += 1) { while (it.next()) |entry| : (i += 1) {
const host_buffer = entry.value_ptr.*; const host_buffer = entry.value_ptr.*;
total_bytes += host_buffer.data.len; total_bytes += host_buffer.data.len;
std.debug.print("Buffer: {any} / {any}\n", .{ i + 1, buffer_store.buffers.count() }); std.debug.print("Buffer: {s} ({any} / {any})\n", .{ entry.key_ptr.*, i + 1, buffer_store.buffers.count() });
buffers[i] = try zml.Buffer.from(platform, host_buffer); buffers[i] = try zml.Buffer.from(platform, host_buffer);
} }