| 634 | GGML_TYPE_F32); |
| 635 | } |
| 636 | |
| 637 | core::TensorValue codebook_decode( |
| 638 | core::ModuleBuildContext & build_ctx, |
| 639 | ggml_tensor * codes_t_b, |
| 640 | const CodebookWeights & codebook, |
| 641 | int64_t dim, |
| 642 | int64_t size, |
| 643 | core::ConstantTensorCache & constants) { |
| 644 | auto indices = core::wrap_tensor( |
| 645 | codes_t_b, |
| 646 | core::TensorShape::from_dims({codes_t_b->ne[1], codes_t_b->ne[0]}), |
| 647 | GGML_TYPE_I32); |
| 648 | indices = core::ensure_backend_addressable_layout(build_ctx, indices); |
| 649 | const auto table = constants.make_f32(core::TensorShape::from_dims({size, dim}), codebook.embedding); |
| 650 | return modules::CodebookLookupModule({size, dim}).build(build_ctx, indices, table); |
| 651 | } |
| 652 | |
| 653 | core::TensorValue quantizer_decode( |
no test coverage detected