def _write_shape()

in src/sagemaker_training/recordio.py [0:0]


def _write_shape(resolved_type, record, scalar):
    """Writes the shape entry in the Record.

    Args:
        resolved_type (str): Representing the type of key entry.
        record (Record object): Record to which the key will be added.
        scalar (int or float32 or float64): The shape to added to the record.
    """
    if resolved_type == "Int32":
        record.features["values"].int32_tensor.shape.extend([scalar])
    elif resolved_type == "Float64":
        record.features["values"].float64_tensor.shape.extend([scalar])
    elif resolved_type == "Float32":
        record.features["values"].float32_tensor.shape.extend([scalar])