File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
aten/src/ATen/native/mps/operations Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1515 const bool is_div,
1616 const string op_name)
1717{
18- if (&output != &self) {
19- output.resize_ (output.sizes ());
18+ if (value_opt.toDouble () == 0.0 ) {
19+ output.copy_ (self);
20+ return output;
2021 }
2122
2223 if (output.numel () == 0 ) {
4950 newCachedGraph->inputTensor = mpsGraphRankedPlaceHolder (mpsGraph, self);
5051 newCachedGraph->firstTensor = mpsGraphRankedPlaceHolder (mpsGraph, tensor1);
5152 newCachedGraph->secondTensor = mpsGraphRankedPlaceHolder (mpsGraph, tensor2);
52- newCachedGraph->valueTensor = mpsGraphUnrankedPlaceHolder (mpsGraph, getMPSScalarType (self.scalar_type ()));
53+ newCachedGraph->valueTensor = mpsGraphRankedPlaceHolder (mpsGraph, getMPSScalarType (self.scalar_type ()), @[@ 1 ] );
5354
5455 // the tensor to be optionally multiplied by value_scalar
5556 MPSGraphTensor *multiplicandTensor = nil ;
You can’t perform that action at this time.
0 commit comments