Skip to content

Commit

Permalink
feat: add syncing models utility to ivy (#28818)
Browse files Browse the repository at this point in the history
  • Loading branch information
YushaArif99 authored Sep 19, 2024
1 parent 6449c70 commit ba475c1
Show file tree
Hide file tree
Showing 3 changed files with 806 additions and 2 deletions.
26 changes: 24 additions & 2 deletions ivy/functional/backends/tensorflow/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,35 @@
import re
import os
import tensorflow as tf
import keras
import numpy as np
import functools
from tensorflow.python.util import nest
from typing import NamedTuple, Callable, Any, Tuple, List, Dict, Type, Union
from typing import (
NamedTuple,
Callable,
Any,
Tuple,
List,
Dict,
Type,
Union,
TYPE_CHECKING,
)
import inspect
from collections import OrderedDict
from packaging.version import parse
import keras

if TYPE_CHECKING:
import torch.nn as nn


if keras.__version__ >= "3.0.0":
KerasVariable = keras.src.backend.Variable
else:
KerasVariable = tf.Variable




def get_assignment_dict():
Expand Down
2 changes: 2 additions & 0 deletions ivy/stateful/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
from .optimizers import *
from . import sequential
from .sequential import *
from . import utilities
from .utilities import sync_models
Loading

0 comments on commit ba475c1

Please sign in to comment.