parameters: (op)
return_statement: return [result_shape] * op.get_attr("num_partitions")
docstring: Shape function for data_flow_ops.dynamic_partition.
docstring_summary: Shape function for data_flow_ops.dynamic_partition.
docstring_tokens: Shape function for data_flow_ops . dynamic_partition .
function: def _DynamicPartitionShape(op):
    """Shape function for data_flow_ops.dynamic_partition."""
    data_shape = op.inputs[0].get_shape()
    partitions_shape = op.inputs[1].get_shape()
    # If we don't know the rank of partitions, we don't know anything
    mid = partitions_shape.ndims
    if mid is None:
      result_shape = tensor_shape.unknown_shape()
    else:
      # data_shape must start with partitions_shape
      partitions_shape.assert_is_compatible_with(data_shape[:mid])
      # The partition shape is dynamic in the 0th dimension, and matches
      # data_shape in the remaining dimensions.
      result_shape = tensor_shape.TensorShape([None]).concatenate(
          data_shape[mid:])
    return [result_shape] * op.get_attr("num_partitions")
function_tokens: def _DynamicPartitionShape ( op ) : data_shape = op . inputs [ 0 ] . get_shape ( ) partitions_shape = op . inputs [ 1 ] . get_shape ( ) # If we don't know the rank of partitions, we don't know anything mid = partitions_shape . ndims if mid is None : result_shape = tensor_shape . unknown_shape ( ) else : # data_shape must start with partitions_shape partitions_shape . assert_is_compatible_with ( data_shape [ : mid ] ) # The partition shape is dynamic in the 0th dimension, and matches # data_shape in the remaining dimensions. result_shape = tensor_shape . TensorShape ( [ None ] ) . concatenate ( data_shape [ mid : ] ) return [ result_shape ] * op . get_attr ( "num_partitions" )