File: test_nccl.py

package info (click to toggle)
caffe-contrib 1.0.0%2Bgit20180821.99bd997-2
  • links: PTS, VCS
  • area: contrib
  • in suites: buster
  • size: 16,244 kB
  • sloc: cpp: 61,579; python: 5,783; makefile: 586; sh: 562
file content (19 lines) | stat: -rw-r--r-- 457 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import sys
import unittest

import caffe


class TestNCCL(unittest.TestCase):

    def test_newuid(self):
        """
        Test that NCCL uids are of the proper type
        according to python version
        """
        if caffe.has_nccl():
            uid = caffe.NCCL.new_uid()
            if sys.version_info.major >= 3:
                self.assertTrue(isinstance(uid, bytes))
            else:
                self.assertTrue(isinstance(uid, str))