Skip to content

Commit

Permalink
fix mix transformer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
divyashreepathihalli committed Dec 1, 2023
1 parent 124c79a commit 77c5b66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions keras_cv/backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
if hasattr(keras, "version") and keras.version().startswith("3."):
_USE_KERAS_3 = True


def detect_if_tensorflow_uses_keras_3():
# We follow the version of keras that tensorflow is configured to use.
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from keras_cv import layers as cv_layers
from keras_cv.api_export import keras_cv_export
from keras_cv.backend import keras
from keras_cv.backend import ops
from keras_cv.models import utils
from keras_cv.models.backbones.backbone import Backbone
from keras_cv.models.backbones.mix_transformer.mix_transformer_backbone_presets import ( # noqa: E501
Expand Down Expand Up @@ -140,8 +139,8 @@ def __init__(
# call in `OverlappingPatchingAndEmbedding`
stride = 4 if i == 0 else 2
new_height, new_width = (
int(ops.shape(x)[1] / stride),
int(ops.shape(x)[2] / stride),
int(x.shape[1] / stride),
int(x.shape[2] / stride),
)

x = patch_embedding_layers[i](x)
Expand Down

0 comments on commit 77c5b66

Please sign in to comment.