"src/array/git@developer.sourcefind.cn:OpenDAS/dgl.git" did not exist on "dc06060bb387b36c1687e9e64c8711e8e91081ba"
Unverified Commit fb4b9580 authored by srihari-humbarwadi's avatar srihari-humbarwadi
Browse files

add missing `from_config` method

parent c1b65fc1
...@@ -29,7 +29,7 @@ class BilinearGridSampler(tf.keras.layers.Layer): ...@@ -29,7 +29,7 @@ class BilinearGridSampler(tf.keras.layers.Layer):
align_corners: A `bool` bool, if True, the centers of the 4 corner align_corners: A `bool` bool, if True, the centers of the 4 corner
pixels of the input and output tensors are aligned, preserving the pixels of the input and output tensors are aligned, preserving the
values at the corner pixels. values at the corner pixels.
""" """
super(BilinearGridSampler, self).__init__(**kwargs) super(BilinearGridSampler, self).__init__(**kwargs)
self.align_corners = align_corners self.align_corners = align_corners
...@@ -121,13 +121,16 @@ class BilinearGridSampler(tf.keras.layers.Layer): ...@@ -121,13 +121,16 @@ class BilinearGridSampler(tf.keras.layers.Layer):
def get_config(self): def get_config(self):
return self._config_dict return self._config_dict
@classmethod
def from_config(cls, config):
return cls(**config)
class PasteMasks(tf.keras.layers.Layer): class PasteMasks(tf.keras.layers.Layer):
"""Layer to paste instance masks.""" """Layer to paste instance masks."""
def __init__(self, output_size: List[int], def __init__(self, output_size: List[int],
grid_sampler, **kwargs): grid_sampler, **kwargs):
"""Generates panoptic segmentation masks. """Generates panoptic segmentation masks.
Args: Args:
...@@ -169,3 +172,7 @@ class PasteMasks(tf.keras.layers.Layer): ...@@ -169,3 +172,7 @@ class PasteMasks(tf.keras.layers.Layer):
def get_config(self): def get_config(self):
return self._config_dict return self._config_dict
@classmethod
def from_config(cls, config):
return cls(**config)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment