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 1414 const bool is_div,
1515 const string op_name)
1616{
17- if (&output != &self) {
18- output.resize_ (output.sizes ());
17+ if (value_opt.toDouble () == 0.0 ) {
18+ output.copy_ (self);
19+ return output;
1920 }
2021
2122 if (output.numel () == 0 ) {
4849 newCachedGraph->inputTensor = mpsGraphRankedPlaceHolder (mpsGraph, self);
4950 newCachedGraph->firstTensor = mpsGraphRankedPlaceHolder (mpsGraph, tensor1);
5051 newCachedGraph->secondTensor = mpsGraphRankedPlaceHolder (mpsGraph, tensor2);
51- newCachedGraph->valueTensor = mpsGraphUnrankedPlaceHolder (mpsGraph, getMPSScalarType (self.scalar_type ()));
52+ newCachedGraph->valueTensor = mpsGraphRankedPlaceHolder (mpsGraph, getMPSScalarType (self.scalar_type ()), @[@ 1 ] );
5253
5354 // the tensor to be optionally multiplied by value_scalar
5455 MPSGraphTensor *multiplicandTensor = nil ;
You can’t perform that action at this time.
0 commit comments