Like array_ops.zeros_like() but also accepts resource var handles.
(op_output)
| 508 | # TODO(skyewm): make this return constants if op_output's shape is fully |
| 509 | # defined (this can be done by checking the "shape" attr of resource vars). |
| 510 | def _zeros_like(op_output): |
| 511 | """Like array_ops.zeros_like() but also accepts resource var handles.""" |
| 512 | if op_output.dtype == dtypes.resource: |
| 513 | return array_ops.zeros( |
| 514 | gen_resource_variable_ops.variable_shape(op_output)) |
| 515 | return array_ops.zeros_like(op_output) |
| 516 | |
| 517 | |
| 518 | def _is_trainable(tensor): |
no test coverage detected