MCPcopy Create free account
hub / github.com/evilsocket/cake / make_f16_tensor

Function make_f16_tensor

cake-core/tests/protocol.rs:21–28  ·  view source on GitHub ↗
(shape: &[usize])

Source from the content-addressed store, hash-verified

19// ============================================================================
20
21fn make_f16_tensor(shape: &[usize]) -> Tensor {
22 let n: usize = shape.iter().product();
23 let data: Vec<f32> = (0..n).map(|i| i as f32 * 0.01).collect();
24 Tensor::from_vec(data, shape, &Device::Cpu)
25 .unwrap()
26 .to_dtype(DType::F16)
27 .unwrap()
28}
29
30fn mock_worker_info(latency: u128) -> WorkerInfo {
31 WorkerInfo {

Callers 8

test_single_op_echoFunction · 0.70
test_batch_echoFunction · 0.70
bench_serializationFunction · 0.70
bench_tcp_roundtripFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected