File: test_io.m

package info (click to toggle)
caffe 1.0.0%2Bgit20180821.99bd997-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,288 kB
  • sloc: cpp: 61,586; python: 5,783; makefile: 599; sh: 559
file content (18 lines) | stat: -rw-r--r-- 648 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
classdef test_io < matlab.unittest.TestCase
  methods (Test)
    function test_read_write_mean(self)
      % randomly generate mean data
      width = 200;
      height = 300;
      channels = 3;
      mean_data_write = 255 * rand(width, height, channels, 'single');
      % write mean data to binary proto
      mean_proto_file = tempname();
      caffe.io.write_mean(mean_data_write, mean_proto_file);
      % read mean data from saved binary proto and test whether they are equal
      mean_data_read = caffe.io.read_mean(mean_proto_file);
      self.verifyEqual(mean_data_write, mean_data_read)
      delete(mean_proto_file);
    end
  end
end