4 The IDEEP test utils is a small addition on top of the hypothesis test utils 5 under caffe2/python, which allows one to more easily test IDEEP related 9 from __future__
import absolute_import
10 from __future__
import division
11 from __future__
import print_function
12 from __future__
import unicode_literals
14 import hypothesis.strategies
as st
16 from caffe2.proto
import caffe2_pb2
21 ideep_do = caffe2_pb2.DeviceOption(device_type=caffe2_pb2.IDEEP)
22 device_options = hu.device_options + ([ideep_do])
25 def device_checker_device_options():
26 return st.just(device_options)
29 def gradient_checker_device_option():
30 return st.sampled_from(device_options)
34 gc=gradient_checker_device_option(),
35 dc=device_checker_device_options()
38 gcs_cpu_only = dict(gc=st.sampled_from([cpu_do]), dc=st.just([cpu_do]))
39 gcs_ideep_only = dict(gc=st.sampled_from([ideep_do]), dc=st.just([ideep_do]))
40 gcs_cpu_ideep = dict(gc=st.sampled_from([cpu_do, ideep_do]), dc=st.just([cpu_do, ideep_do]))