| 1961 | """ |
| 1962 | |
| 1963 | def __init__(self, |
| 1964 | size=(2, 2), |
| 1965 | data_format=None, |
| 1966 | interpolation='nearest', |
| 1967 | **kwargs): |
| 1968 | super(UpSampling2D, self).__init__(**kwargs) |
| 1969 | self.data_format = conv_utils.normalize_data_format(data_format) |
| 1970 | self.size = conv_utils.normalize_tuple(size, 2, 'size') |
| 1971 | if interpolation not in {'nearest', 'bilinear'}: |
| 1972 | raise ValueError('`interpolation` argument should be one of `"nearest"` ' |
| 1973 | 'or `"bilinear"`.') |
| 1974 | self.interpolation = interpolation |
| 1975 | self.input_spec = InputSpec(ndim=4) |
| 1976 | |
| 1977 | def compute_output_shape(self, input_shape): |
| 1978 | input_shape = tensor_shape.TensorShape(input_shape).as_list() |