(self, inputs)
| 109 | tf.ones_like(patch_embeds[..., 0]), 1024, normalize=False) |
| 110 | |
| 111 | def call(self, inputs): # pytype: disable=signature-mismatch # overriding-parameter-count-checks |
| 112 | if isinstance(inputs, dict): |
| 113 | images = inputs.get('images', None) |
| 114 | patch_embeds = inputs.get('embeddings', None) |
| 115 | else: |
| 116 | raise ValueError('Unexpected inputs type to %s.' % self.__class__) |
| 117 | if images is not None: |
| 118 | patches = to_patch(images, self.patch_h, self.patch_w) |
| 119 | patch_embeds = self.to_embed(patches) |
| 120 | patch_shape = tf.shape(patch_embeds) |
| 121 | patch_embeds = self.add_position_embed(patch_embeds) |
| 122 | patch_embeds = tf.reshape(patch_embeds, |
| 123 | (patch_shape[0], -1, patch_shape[-1])) |
| 124 | patch_embeds = self.insert_cls(patch_embeds) |
| 125 | return self.encoder(patch_embeds) |
nothing calls this directly
no test coverage detected