| 126 | "Applies precomputed 2D batch-normalization eval scale and bias to [batch, channels, height, width] tensors.", |
| 127 | }; |
| 128 | |
| 129 | core::TensorValue ensure_f32( |
| 130 | core::ModuleBuildContext & ctx, |
| 131 | const core::TensorValue & value) { |
| 132 | if (value.type == GGML_TYPE_F32) { |
| 133 | return value; |
| 134 | } |
| 135 | return core::wrap_tensor(ggml_cast(ctx.ggml, value.tensor, GGML_TYPE_F32), value.shape, GGML_TYPE_F32); |
| 136 | } |
| 137 | |
| 138 | bool same_shape(const core::TensorShape & lhs, const core::TensorShape & rhs) { |
| 139 | if (lhs.rank != rhs.rank) { |
| 140 | return false; |
| 141 | } |
| 142 | for (size_t i = 0; i < lhs.rank; ++i) { |
| 143 | if (lhs.dims[i] != rhs.dims[i]) { |
| 144 | return false; |
| 145 | } |
no test coverage detected