/graph.zig Secret
Created
December 18, 2019 17:14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Add = struct { | |
operation: Operation, | |
nodes: [2]Node, | |
pub fn init(left: Tensor(f64, 0), right: Tensor(f64, 0)) Add { | |
return .{ | |
.operation = .{ .inputs = inputs }, | |
.nodes = [_]Node{ left, right }, | |
}; | |
} | |
pub fn inputs(operation: *const Operation) []const Node { | |
const self = @fieldParentPtr(Add, "operation", operation); | |
return &self.nodes; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment