MCPcopy Create free account
hub / github.com/pytorch/pytorch / device_equal

Function device_equal

caffe2/python/core.py:2425–2431  ·  view source on GitHub ↗

We are using this fucntion instead of == operator because optional-value comparison between empty device_options and {device_type:0, device_id:0} returns not equal in some cases.

(src, dst)

Source from the content-addressed store, hash-verified

2423
2424
2425def device_equal(src, dst):
2426 '''
2427 We are using this fucntion instead of == operator because optional-value
2428 comparison between empty device_options and {device_type:0, device_id:0}
2429 returns not equal in some cases.
2430 '''
2431 return src.device_type == dst.device_type and src.device_id == dst.device_id
2432
2433
2434def update_placeholder_op_output(op, blob_to_device):

Callers 1

InjectCrossDeviceCopiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…