| 221 | } |
| 222 | |
| 223 | SnakeExactWeights load_snake_exact( |
| 224 | core::BackendWeightStore & store, |
| 225 | const assets::TensorSource & source, |
| 226 | const std::string & prefix, |
| 227 | int64_t channels) { |
| 228 | SnakeExactWeights out = {}; |
| 229 | const auto alpha = source.require_f32(prefix + ".alpha", {1, channels, 1}); |
| 230 | const auto beta = source.require_f32(prefix + ".beta", {1, channels, 1}); |
| 231 | out.alpha = store.make_from_f32( |
| 232 | core::TensorShape::from_dims({1, channels, 1}), |
| 233 | assets::TensorStorageType::F32, |
| 234 | snake_exp_transform(alpha)); |
| 235 | out.beta_inv = store.make_from_f32( |
| 236 | core::TensorShape::from_dims({1, channels, 1}), |
| 237 | assets::TensorStorageType::F32, |
| 238 | snake_inverse_beta_transform(beta)); |
| 239 | return out; |
| 240 | } |
| 241 | |
| 242 | WeightNormConv1dWeights load_weight_norm_conv1d( |
| 243 | core::BackendWeightStore & store, |
no test coverage detected