(fname: &str)
| 137 | } |
| 138 | |
| 139 | fn path(fname: &str) -> Result<String, &'static str> { |
| 140 | |
| 141 | match home_dir() { |
| 142 | Some(ref mut p) => { |
| 143 | p.push(Path::new(MNIST_PATH)); |
| 144 | p.push(Path::new(fname)); |
| 145 | Ok(p.as_path().to_str().unwrap().to_string()) |
| 146 | } |
| 147 | None => Err("Could not get home directory.") |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | /// Reads the default MNIST training set. |
| 152 | /// |