def output_shape(self, input_shape): """Determine the output shape given the input shape.""" depth = convnet.depth_to_space_channels(input_shape[-1], self.block_size) shape = convnet.image_output_size( input_shape, (self.patch_size, self.patch_size, input_shape[3], depth), (1, 1), self.padding ) return convnet.depth_to_space_shape(shape, {"block_size":self.block_size})
def output_shape(self, input_shape): """Determine the output shape given the input shape.""" depth = self.output_channels if self.operation.startswith("conv") else input_shape[3] return convnet.image_output_size( input_shape, (self.patch_size, self.patch_size, input_shape[3], depth), (self.stride, self.stride), self.padding )