Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions aten/src/ATen/native/mps/operations/PointwiseOps.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
const bool is_div,
const string op_name)
{
if (&output != &self) {
output.resize_(output.sizes());
if (value_opt.toDouble() == 0.0) {
output.copy_(self);
return output;
}
MPSStream* mpsStream = getCurrentMPSStream();

Expand Down Expand Up @@ -44,7 +45,7 @@
newCachedGraph->inputTensor = mpsGraphRankedPlaceHolder(mpsGraph, self);
newCachedGraph->firstTensor = mpsGraphRankedPlaceHolder(mpsGraph, tensor1);
newCachedGraph->secondTensor = mpsGraphRankedPlaceHolder(mpsGraph, tensor2);
newCachedGraph->valueTensor = mpsGraphUnrankedPlaceHolder(mpsGraph, getMPSScalarType(self.scalar_type()));
newCachedGraph->valueTensor = mpsGraphRankedPlaceHolder(mpsGraph, getMPSScalarType(self.scalar_type()), @[@1]);

// the tensor to be optionally multiplied by value_scalar
MPSGraphTensor *multiplicandTensor = nil;
Expand Down