Skip to content

Commit 3e49d8b

Browse files
committed
Value and Documentation
1 parent 1c41a91 commit 3e49d8b

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

build.zig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,21 @@ pub fn build(b: *std.Build) void {
113113
const test_step = b.step("test", "Run unit tests");
114114
test_step.dependOn(&run_lib_unit_tests.step);
115115
test_step.dependOn(&run_exe_unit_tests.step);
116+
117+
// Creates a step for generating documentation
118+
const lib_docs = b.addObject(.{
119+
.name = "micrograd-docs",
120+
.root_module = lib_mod,
121+
});
122+
123+
// Generate documentation and install it to zig-out/docs
124+
const docs = lib_docs.getEmittedDocs();
125+
const install_docs = b.addInstallDirectory(.{
126+
.source_dir = docs,
127+
.install_dir = .prefix,
128+
.install_subdir = "docs",
129+
});
130+
131+
const docs_step = b.step("docs", "Generate and install documentation");
132+
docs_step.dependOn(&install_docs.step);
116133
}

src/engine.zig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//! This file provides
2+
3+
const std = @import("std");
4+
const arch = @import("../arch/arch.zig");
5+
6+
/// Represents a Scalar value
7+
pub fn Value(comptime T: type) type {
8+
return struct {
9+
/// Value of the register
10+
value: T,
11+
12+
/// Initialize the Value
13+
pub fn init(value: T) @This() {
14+
return @This(){
15+
.value = value,
16+
};
17+
}
18+
19+
};
20+
}

src/nn.zig

Whitespace-only changes.

0 commit comments

Comments
 (0)