Skip to content

Commit

Permalink
[Metal] Add pin_memory check in empty_strided (#47228)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #47228

Add the false checking if pin_memory has been specified to `False`
ghstack-source-id: 115715087

Test Plan:
- CircleCI
- Sandcastle

Reviewed By: IvanKobzarev

Differential Revision: D24690472

fbshipit-source-id: c65fc494fcd7b0b409a80c86e108a029ca7fd71e
  • Loading branch information
xta0 authored and facebook-github-bot committed Nov 2, 2020
1 parent e038206 commit 7f125bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aten/src/ATen/native/metal/MetalAten.mm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Tensor empty(
optional<Device> device,
optional<bool> pin_memory) {
TORCH_CHECK(
!pin_memory.has_value(),
!pin_memory.has_value() || !pin_memory.value(),
"'pin_memory' argument is incompatible with Metal tensor");
MetalTensor mt{size.vec(), stride.vec()};
return MetalTensor::toTensor(
Expand Down

0 comments on commit 7f125bc

Please sign in to comment.