(handle, out_type=dtypes.int32)
| 1863 | |
| 1864 | |
| 1865 | def variable_shape(handle, out_type=dtypes.int32): |
| 1866 | if getattr( |
| 1867 | handle, "_handle_data", None) is None or not handle._handle_data.is_set: # pylint: disable=protected-access |
| 1868 | return gen_resource_variable_ops.variable_shape(handle, out_type=out_type) |
| 1869 | shape_proto = handle._handle_data.shape_and_type[0].shape # pylint: disable=protected-access |
| 1870 | if shape_proto.unknown_rank or any(x.size == -1 for x in shape_proto.dim): |
| 1871 | return gen_resource_variable_ops.variable_shape(handle, out_type=out_type) |
| 1872 | return constant_op.constant([x.size for x in shape_proto.dim], dtype=out_type) |
| 1873 | |
| 1874 | |
| 1875 | @ops.RegisterGradient("ResourceGather") |
no test coverage detected