-
-
Save fengb/e2ab6f36bd720016d5f970109dc2b395 to your computer and use it in GitHub Desktop.
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