def _write_feature_tensor()

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


def _write_feature_tensor(resolved_type, record, vector):
    """Write the feature tensor in the record based on the resolved type.

    Args:
        resolved_type (str): String representing the feature type.
        record (Record object): Record object to write to.
        vector (np.array or csr_matrix): Represents the row (1D Array).
    """
    if resolved_type == "Int32":
        record.features["values"].int32_tensor.values.extend(vector)
    elif resolved_type == "Float64":
        record.features["values"].float64_tensor.values.extend(vector)
    elif resolved_type == "Float32":
        record.features["values"].float32_tensor.values.extend(vector)