| 311 | save_dir: directory name of where the saved model will be stored. |
| 312 | """ |
| 313 | class CustomModule(tf.Module): |
| 314 | |
| 315 | def __init__(self): |
| 316 | super(CustomModule, self).__init__() |
| 317 | |
| 318 | @tf.function(input_signature=[tf.TensorSpec([], tf.int32), |
| 319 | tf.TensorSpec([], tf.int32), |
| 320 | tf.TensorSpec([], tf.int32)]) |
| 321 | def control_flow(self, x, y, z): |
| 322 | i = 0 |
| 323 | while i < z: |
| 324 | i += 1 |
| 325 | j = 0 |
| 326 | while j < y: |
| 327 | j += 1 |
| 328 | if z > 0: |
| 329 | x += 1 |
| 330 | else: |
| 331 | x += 2 |
| 332 | return x |
| 333 | |
| 334 | |
| 335 | module = CustomModule() |
no outgoing calls
no test coverage detected
searching dependent graphs…