Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for get_size_ratio (0.27 sec)

  1. tensorflow/compiler/mlir/quantization/common/python/testing_test.py

        self.assertEqual(testing.get_dir_size(self.path_a), 4)
        self.assertEqual(testing.get_dir_size(self.path_b), 8)
    
      def test_get_size_ratio(self):
        self.assertEqual(testing.get_size_ratio(self.path_a, self.path_b), 0.5)
        self.assertEqual(testing.get_size_ratio(self.path_b, self.path_a), 2.0)
    
    
    if __name__ == '__main__':
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Mar 21 08:51:46 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/common/python/testing.py

      """
      total = 0
      for root, _, files in os.walk(path):
        for filename in files:
          total += os.path.getsize(os.path.join(root, filename))
      return total
    
    
    def get_size_ratio(path_a: str, path_b: str) -> float:
      """Return the size ratio of the given paths.
    
      Args:
        path_a: Path of a directory or a file to be the nominator of the ratio.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Mar 21 08:51:46 UTC 2024
    - 2.2K bytes
    - Viewed (0)
Back to top