Skip to content

Commit a8ec572

Browse files
h-jooedward-bot
authored andcommitted
Internal change
PiperOrigin-RevId: 941350466
1 parent 1a745a6 commit a8ec572

149 files changed

Lines changed: 340 additions & 340 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

edward2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

edward2/jax/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

edward2/jax/nn/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

edward2/jax/nn/attention.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -182,12 +182,12 @@ def f(x, *args, **kwargs):
182182
query,
183183
key,
184184
value,
185-
mask=mask,
186-
dropout_rng=dropout_rng,
187-
dropout_rate=self.dropout_rate,
188-
broadcast_dropout=self.broadcast_dropout,
189-
deterministic=deterministic,
190-
dtype=self.dtype,
185+
mask=mask, # pyrefly: ignore[unexpected-keyword]
186+
dropout_rng=dropout_rng, # pyrefly: ignore[unexpected-keyword]
187+
dropout_rate=self.dropout_rate, # pyrefly: ignore[unexpected-keyword]
188+
broadcast_dropout=self.broadcast_dropout, # pyrefly: ignore[unexpected-keyword]
189+
deterministic=deterministic, # pyrefly: ignore[unexpected-keyword]
190+
dtype=self.dtype, # pyrefly: ignore[unexpected-keyword]
191191
precision=self.precision) # pytype: disable=wrong-keyword-args
192192
# back to the original inputs dimensions
193193
def dense_fn2(name):

edward2/jax/nn/attention_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

edward2/jax/nn/dense.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

edward2/jax/nn/dense_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

edward2/jax/nn/heteroscedastic_lib.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -257,7 +257,7 @@ def _compute_noise_samples(self, scale, num_samples):
257257
def get_temperature(self):
258258
if self.tune_temperature:
259259
return compute_temperature(
260-
self._pre_sigmoid_temperature,
260+
self._pre_sigmoid_temperature, # pyrefly: ignore[bad-argument-type]
261261
lower=self.temperature_lower_bound,
262262
upper=self.temperature_upper_bound)
263263
else:
@@ -510,7 +510,7 @@ def _compute_noise_samples(self, scale, num_samples):
510510
def get_temperature(self):
511511
if self.tune_temperature:
512512
return compute_temperature(
513-
self._pre_sigmoid_temperature,
513+
self._pre_sigmoid_temperature, # pyrefly: ignore[bad-argument-type]
514514
lower=self.temperature_lower_bound,
515515
upper=self.temperature_upper_bound)
516516
else:
@@ -609,33 +609,33 @@ def setup(self):
609609
self.actual_latent_dim = self.latent_dim
610610

611611
if self.parameter_efficient:
612-
self._scale_layer_homoscedastic = dense.DenseBatchEnsemble(
612+
self._scale_layer_homoscedastic = dense.DenseBatchEnsemble( # pyrefly: ignore[bad-assignment]
613613
self.actual_latent_dim,
614614
ens_size=self.ens_size,
615615
alpha_init=self.alpha_init,
616616
gamma_init=self.gamma_init,
617617
kernel_init=self.kernel_init,
618618
name='scale_layer_homoscedastic')
619-
self._scale_layer_heteroscedastic = dense.DenseBatchEnsemble(
619+
self._scale_layer_heteroscedastic = dense.DenseBatchEnsemble( # pyrefly: ignore[bad-assignment]
620620
self.actual_latent_dim,
621621
ens_size=self.ens_size,
622622
alpha_init=self.alpha_init,
623623
gamma_init=self.gamma_init,
624624
kernel_init=self.kernel_init,
625625
name='scale_layer_heteroscedastic')
626626
elif self.num_factors > 0:
627-
self._scale_layer = dense.DenseBatchEnsemble(
627+
self._scale_layer = dense.DenseBatchEnsemble( # pyrefly: ignore[bad-assignment]
628628
self.actual_latent_dim * self.num_factors,
629629
ens_size=self.ens_size,
630630
alpha_init=self.alpha_init,
631631
gamma_init=self.gamma_init,
632632
kernel_init=self.kernel_init,
633633
name='scale_layer')
634634

635-
self._loc_layer = dense.DenseBatchEnsemble(self.num_classes,
635+
self._loc_layer = dense.DenseBatchEnsemble(self.num_classes, # pyrefly: ignore[bad-assignment]
636636
ens_size=self.ens_size,
637637
name='loc_layer')
638-
self._diag_layer = dense.DenseBatchEnsemble(self.actual_latent_dim,
638+
self._diag_layer = dense.DenseBatchEnsemble(self.actual_latent_dim, # pyrefly: ignore[bad-assignment]
639639
ens_size=self.ens_size,
640640
name='diag_layer')
641641

@@ -664,36 +664,36 @@ def setup(self):
664664
self.actual_latent_dim = self.latent_dim
665665

666666
if self.parameter_efficient:
667-
self._scale_layer_homoscedastic = dense.DenseBatchEnsemble(
667+
self._scale_layer_homoscedastic = dense.DenseBatchEnsemble( # pyrefly: ignore[bad-assignment]
668668
self.actual_latent_dim,
669669
ens_size=self.ens_size,
670670
alpha_init=self.alpha_init,
671671
gamma_init=self.gamma_init,
672672
kernel_init=self.kernel_init,
673673
name='scale_layer_homoscedastic')
674-
self._scale_layer_heteroscedastic = dense.DenseBatchEnsemble(
674+
self._scale_layer_heteroscedastic = dense.DenseBatchEnsemble( # pyrefly: ignore[bad-assignment]
675675
self.actual_latent_dim,
676676
ens_size=self.ens_size,
677677
alpha_init=self.alpha_init,
678678
gamma_init=self.gamma_init,
679679
kernel_init=self.kernel_init,
680680
name='scale_layer_heteroscedastic')
681681
elif self.num_factors > 0:
682-
self._scale_layer = dense.DenseBatchEnsemble(
682+
self._scale_layer = dense.DenseBatchEnsemble( # pyrefly: ignore[bad-assignment]
683683
self.actual_latent_dim * self.num_factors,
684684
ens_size=self.ens_size,
685685
alpha_init=self.alpha_init,
686686
gamma_init=self.gamma_init,
687687
kernel_init=self.kernel_init,
688688
name='scale_layer')
689689

690-
self._loc_layer = dense.DenseBatchEnsemble(self.num_outputs,
690+
self._loc_layer = dense.DenseBatchEnsemble(self.num_outputs, # pyrefly: ignore[bad-assignment]
691691
ens_size=self.ens_size,
692692
alpha_init=self.alpha_init,
693693
gamma_init=self.gamma_init,
694694
kernel_init=self.kernel_init,
695695
name='loc_layer')
696-
self._diag_layer = dense.DenseBatchEnsemble(self.actual_latent_dim,
696+
self._diag_layer = dense.DenseBatchEnsemble(self.actual_latent_dim, # pyrefly: ignore[bad-assignment]
697697
ens_size=self.ens_size,
698698
alpha_init=self.alpha_init,
699699
gamma_init=self.gamma_init,

edward2/jax/nn/normalization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -187,7 +187,7 @@ def scan_body(carry, _):
187187

188188
class SpectralNormalizationConv2D(SpectralNormalization):
189189
__doc__ = "Implements spectral normalization for Conv layers based on [2].\n" + "\n".join(
190-
SpectralNormalization.__doc__.split("\n")[1:])
190+
SpectralNormalization.__doc__.split("\n")[1:]) # pyrefly: ignore[missing-attribute]
191191

192192
kernel_apply_kwargs: Mapping[str, Any] = flax.core.FrozenDict(
193193
feature_group_count=1, padding="SAME", use_bias=False)
@@ -208,8 +208,8 @@ def _abs_sq(x):
208208
# promote x to at least float32, this avoids half precision computation
209209
# but preserves double or complex floating points
210210
x = jnp.asarray(x, jnp.promote_types(jnp.float32, jnp.result_type(x)))
211-
mean = jnp.mean(x, axes)
212-
mean2 = jnp.mean(_abs_sq(x), axes)
211+
mean = jnp.mean(x, axes) # pyrefly: ignore[bad-argument-type]
212+
mean2 = jnp.mean(_abs_sq(x), axes) # pyrefly: ignore[bad-argument-type]
213213
if axis_name is not None:
214214
concatenated_mean = jnp.concatenate([mean, mean2])
215215
mean, mean2 = jnp.split(

edward2/jax/nn/normalization_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# coding=utf-8
2-
# Copyright 2025 The Edward2 Authors.
2+
# Copyright 2026 The Edward2 Authors.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)