SerranoTensorSymbol
public class SerranoTensorSymbol: SerranoGraphSymbol, TensorSymbol
Implementation of TensorSymbol
-
Data source. Conforms to
GraphSymbol
.Declaration
Swift
public var dataSource: SymbolDataSource
-
Shape. Conforms to
GraphSymbol
.Declaration
Swift
public var shape: TensorShape
-
Binded data. Conforms to
GraphSymbol
.Declaration
Swift
public var bindedData: DataSymbolSupportedDataType?
-
If differentiable
Declaration
Swift
public var updatable = false
-
Current grad
Declaration
Swift
public var currentGrad: DataSymbolSupportedDataType?
-
If enabled history grads recording. Default is
false
.Declaration
Swift
public var historyGradsEnabled = false
-
grads
Declaration
Swift
public var historyGrads:[DataSymbolSupportedDataType] = [Tensor]()
-
Binded tensor
Declaration
Swift
internal var _bindedData: Tensor?
-
Designated init
Declaration
Swift
public init(dataSource: SymbolDataSource, bindedData: Tensor?, shape: TensorShape, label: String, inBounds: [GraphSymbol], outBounds: [GraphSymbol])
Parameters
dataSource
dataSource
bindedData
bindedData
label
label
inBounds
inBounds
outBounds
outBounds
-
Covenient init
Declaration
Swift
public convenience init(_ label: String = "Tensor Symbol", dataSource: SymbolDataSource, shape: TensorShape)
Parameters
label
label
dataSource
dataSource
-
Bind to a tensor. There two cases could not bind successfull: 1. Passed in
data
is not a tensor object; 2. Passed in tensor object has not compatible shape with attributeshape
.Declaration
Swift
public func bindData(_ data:DataSymbolSupportedDataType) -> Bool
Parameters
data
data. Should be a
Tensor
object.Return Value
bind result