mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-05 00:14:54 +08:00
Add CUDA implementation of BooleanUnmask and fixed some bugs in the test
Reviewed By: akyrola Differential Revision: D5405606 fbshipit-source-id: fd755ee2ec3d742597f7f5500f54caa396db4da4
This commit is contained in:
committed by
Facebook Github Bot
parent
6314c1fc15
commit
0c7ee02c37
@ -598,3 +598,31 @@ class HypothesisTestCase(test_util.TestCase):
|
||||
list(op.input) + list(op.output), inputs + outputs)))
|
||||
else:
|
||||
validator(inputs=inputs, outputs=outputs)
|
||||
|
||||
def assertRunOpRaises(
|
||||
self,
|
||||
device_option,
|
||||
op,
|
||||
inputs,
|
||||
input_device_options=None,
|
||||
exception=(Exception,),
|
||||
regexp=None,
|
||||
):
|
||||
if input_device_options is None:
|
||||
input_device_options = {}
|
||||
|
||||
op = copy.deepcopy(op)
|
||||
op.device_option.CopyFrom(device_option)
|
||||
|
||||
with temp_workspace():
|
||||
for (n, b) in zip(op.input, inputs):
|
||||
workspace.FeedBlob(
|
||||
n,
|
||||
b,
|
||||
device_option=input_device_options.get(n, device_option)
|
||||
)
|
||||
if regexp is None:
|
||||
self.assertRaises(exception, workspace.RunOperatorOnce, op)
|
||||
else:
|
||||
self.assertRaisesRegexp(
|
||||
exception, regexp, workspace.RunOperatorOnce, op)
|
||||
|
||||
Reference in New Issue
Block a user