MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _AssertAtLeast3DImage

Function _AssertAtLeast3DImage

tensorflow/python/ops/image_ops_impl.py:178–197  ·  view source on GitHub ↗

Assert that we are working with a properly shaped image. Performs the check statically if possible (i.e. if the shape is statically known). Otherwise adds a control dependency to an assert op that checks the dynamic shape. Args: image: >= 3-D Tensor of size [*, height, width, depth]

(image)

Source from the content-addressed store, hash-verified

176
177
178def _AssertAtLeast3DImage(image):
179 """Assert that we are working with a properly shaped image.
180
181 Performs the check statically if possible (i.e. if the shape
182 is statically known). Otherwise adds a control dependency
183 to an assert op that checks the dynamic shape.
184
185 Args:
186 image: >= 3-D Tensor of size [*, height, width, depth]
187
188 Raises:
189 ValueError: if image.shape is not a [>= 3] vector.
190
191 Returns:
192 If the shape of `image` could be verified statically, `image` is
193 returned unchanged, otherwise there will be a control dependency
194 added that asserts the correct dynamic shape.
195 """
196 return control_flow_ops.with_dependencies(
197 _CheckAtLeast3DImage(image, require_static=False), image)
198
199
200def _CheckAtLeast3DImage(image, require_static=True):

Callers 6

_random_flipFunction · 0.85
_flipFunction · 0.85
rot90Function · 0.85
transposeFunction · 0.85
central_cropFunction · 0.85

Calls 1

_CheckAtLeast3DImageFunction · 0.85

Tested by

no test coverage detected