Closed ghost closed 1 year ago
i tried
graph!.variable(Tensor<Float16>(ten))[0..<320, 0..<320, 0..<3, 0..<3] = graph!.variable(Tensor<Float16>(cached_weights[name]))[0..<320, 0..<320, 0..<3, 0..<3]
both ten and cached_weights[name] are any tensors.
I get this error: examples/dylib_interface.swift:114:56: error: cannot assign through subscript: function call returns immutable value
examples/dylib_interface.swift:114:56: error: cannot assign through subscript: function call returns immutable value
variable[0..<320, 0..<320, 0..<3, 0..<3] = graph.variable(tensor[0..<320, 0..<320, 0..<3, 0..<3])
You cannot create a variable inplace and assign values.
i tried
both ten and cached_weights[name] are any tensors.
I get this error:
examples/dylib_interface.swift:114:56: error: cannot assign through subscript: function call returns immutable value