Skip to content

Commit

Permalink
fix(backend)(TF)(module.py): minor fixes to the backend Model/Layer c…
Browse files Browse the repository at this point in the history
…lasses
  • Loading branch information
YushaArif99 committed Jul 29, 2024
1 parent 16ab2a9 commit 4e0e14c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ivy/functional/backends/tensorflow/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def recursive_serialize(d):
return {k: recursive_serialize(v) for k, v in d.items()}
elif isinstance(d, list):
return [recursive_serialize(v) for v in d]
elif isinstance(d, tuple):
return tuple(recursive_serialize(v) for v in d)
else:
return serialize_obj(d)

Expand All @@ -254,6 +256,8 @@ def recursive_deserialize(d):
return {k: recursive_deserialize(v) for k, v in d.items()}
elif isinstance(d, list):
return [recursive_deserialize(v) for v in d]
elif isinstance(d, tuple):
return tuple(recursive_serialize(v) for v in d)
else:
return deserialize_obj(d)

Expand Down Expand Up @@ -927,6 +931,10 @@ def state_dict(self):
def module_dict(self):
return self._module_dict

@property
def layers(self):
return self._layers

# Dunder Methods #
# ---------------#
@store_frame_info
Expand Down Expand Up @@ -1405,6 +1413,9 @@ def build(
self._built = True
return

def _lock_state(self):
pass

@tf.autograph.experimental.do_not_convert
def register_buffer(self, name: str, value: Union[tf.Tensor, tf.Variable]):
self._buffers.update({name: value})
Expand Down

0 comments on commit 4e0e14c

Please sign in to comment.