(blob, arg, device_option=None)
| 743 | |
| 744 | |
| 745 | def _Blob_feed(blob, arg, device_option=None): |
| 746 | # conservative type check to avoid unnecessary import |
| 747 | if type(arg).__name__ == 'Tensor' and type(arg).__module__ == 'torch': |
| 748 | import torch |
| 749 | if isinstance(arg, torch.Tensor): |
| 750 | assert device_option is None, \ |
| 751 | "device_option doesn't make sense with PyTorch tensors" |
| 752 | handle = torch._C._tensor_impl_raw_handle(arg) |
| 753 | blob._wrap_tensor_impl(handle) |
| 754 | return True # _feed() returns True for some reason |
| 755 | if device_option is not None: |
| 756 | device_option = StringifyProto(device_option) |
| 757 | return blob._feed(arg, device_option) |
| 758 | |
| 759 | |
| 760 | C.Blob.feed = _Blob_feed |
nothing calls this directly
no test coverage detected
searching dependent graphs…