TensorData

July 8, 2020 ยท View on GitHub

CLASS

TensorData

Contents

public class TensorData<T>

Contains tensor data information to be use for training/validation.

Properties

data

public var data: [T]

Tensor data as a one dimensional array

shape

public let shape: [Int]

Shape of the tensor

Methods

init(data:shape:)

public init(data: [T], shape: [Int]) throws

Initialize a tensor to be used for training/validation in SwiftSyft

  • Parameters:
    • data: tensor data as a 1D array. Must be a floating point type or an integer type
    • shape: an array of integers defining the shape of the tensor

Parameters

NameDescription
datatensor data as a 1D array. Must be a floating point type or an integer type
shapean array of integers defining the shape of the tensor