Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-openvino/openvino/op/repeat.cpp # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-openvino / openvino / op / repeat.cpp` 47 lines ยท 1612 bytes Raw Blame History 1 #include "../node_context.h" 2 #include "../op_table.h" 3 #include "../utils.h" 4 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 13 namespace ov { 14 namespace frontend { 15 namespace ggml { 16 namespace op { 17 18 // GGML_OP_REPEAT tiles src[0] to fill the destination shape. Every destination 19 // dimension is an integer multiple of the corresponding source dimension. 20 OutputVector translate_repeat(const NodeContext & context) { 21 num_inputs_check(context, 1, 2); 22 23 auto input = process_view_input_new(context, 0); 24 25 const auto input_shape = context.get_input_shape(0).to_shape(); 26 const auto output_shape = context.get_output_shape().to_shape(); 27 28 std::vector repeats(4, 1); 29 for (size_t axis = 0; axis < 4; ++axis) { 30 const int64_t input_dim = input_shape[axis]; 31 const int64_t output_dim = output_shape[axis]; 32 33 FRONT_END_OP_CONVERSION_CHECK(input_dim > 0 && output_dim > 0 && output_dim % input_dim == 0, 34 "REPEAT input shape ", input_shape, " cannot tile to match ", output_shape); 35 36 repeats[axis] = output_dim / input_dim; 37 } 38 39 auto repeats_node = ov::op::v0::Constant::create(ov::element::i64, {repeats.size()}, repeats); 40 ov::Output res = std::make_shared(input, repeats_node); 41 return rename_outputs_with_suffix({res}, context.get_name()); 42 } 43 44 } // namespace op 45 } // namespace ggml 46 } // namespace frontend 47 } // namespace ov