Learn R Programming

quickcode (version 1.0.6)

from_tensor_slices: Create Tensor-Like Slices from a Data Frame or Matrix

Description

This function converts a data frame or matrix into row-wise slices, similar to TensorFlow's `from_tensor_slices()`.

Usage

from_tensor_slices(data)

Value

A list of slices, each corresponding to a row of the input data.

Arguments

data

A data frame or matrix to be converted into slices.

Examples

Run this code
df <- data.frame(A = 1:3, B = c("x", "y", "z"))
from_tensor_slices(df)

Run the code above in your browser using DataLab