!39499 codecheck_fix
Merge pull request !39499 from panfengfeng/codecheck_fix
This commit is contained in:
commit
2fe5c963c6
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <numeric>
|
||||
|
|
|
@ -143,7 +143,10 @@ void GridSampler2DCpuKernelMod::ComputeTask(float16 *x_addr, float16 *grid_addr,
|
|||
count--;
|
||||
}
|
||||
out_iter[count] = out_iter[kOne] % LongToSize(output_shape_[count]);
|
||||
out_iter[1] /= LongToSize(output_shape_[count--]);
|
||||
out_iter[1] /= LongToSize(output_shape_[count]);
|
||||
if (count > 0) {
|
||||
count--;
|
||||
}
|
||||
}
|
||||
const size_t out_c = LongToSize(output_shape_[kOne]);
|
||||
int64_t grid_offset =
|
||||
|
|
|
@ -77,7 +77,7 @@ bool TruncateDivCpuKernelMod::LaunchKernel(const std::vector<kernel::AddressPtr>
|
|||
for (size_t i = start; i < end; ++i) {
|
||||
auto dividend = input_addr_a[i];
|
||||
auto divisor = input_addr_b[i];
|
||||
auto zero = (T)0;
|
||||
auto zero = static_cast<T>(0);
|
||||
if (divisor == zero) {
|
||||
if (dividend == zero) {
|
||||
output_addr[i] = std::numeric_limits<T>::quiet_NaN();
|
||||
|
|
|
@ -94,7 +94,7 @@ bool TruncateModCpuKernelMod::LaunchKernel(const std::vector<kernel::AddressPtr>
|
|||
for (size_t i = start; i < end; ++i) {
|
||||
auto dividend = input_addr_a[i];
|
||||
auto divisor = input_addr_b[i];
|
||||
auto zero = (T)0;
|
||||
auto zero = static_cast<T>(0);
|
||||
if (divisor == zero) {
|
||||
if (dividend == zero) {
|
||||
output_addr[i] = std::numeric_limits<T>::quiet_NaN();
|
||||
|
|
|
@ -3175,7 +3175,7 @@ def affine_grid(theta, output_size, align_corners=False):
|
|||
>>> import mindspore.ops as ops
|
||||
>>> theta = Tensor([[[0.8, 0.5, 0],[-0.5, 0.8, 0]]], mindspore.float32)
|
||||
>>> out_size = (1, 3, 2, 3)
|
||||
>>> output = op.affine_grid(theta, out_size, False)
|
||||
>>> output = ops.affine_grid(theta, out_size, False)
|
||||
>>> print(output)
|
||||
[[[[-0.78333336 -0.06666666]
|
||||
[-0.25 -0.4 ]
|
||||
|
|
|
@ -2287,8 +2287,7 @@ def truncate_div(x, y):
|
|||
Examples:
|
||||
>>> x = Tensor(np.array([2, 4, -1]), mindspore.int32)
|
||||
>>> y = Tensor(np.array([3, 3, 3]), mindspore.int32)
|
||||
>>> truncate_div = ops.truncate_div()
|
||||
>>> output = truncate_div(x, y)
|
||||
>>> output = ops.truncate_div(x, y)
|
||||
>>> print(output)
|
||||
[0 1 0]
|
||||
"""
|
||||
|
@ -2327,15 +2326,14 @@ def truncate_mod(x, y):
|
|||
Examples:
|
||||
>>> x = Tensor(np.array([2, 4, -1]), mindspore.int32)
|
||||
>>> y = Tensor(np.array([3, 3, 3]), mindspore.int32)
|
||||
>>> truncate_mod = ops.truncate_mod()
|
||||
>>> output = truncate_mod(x, y)
|
||||
>>> output = ops.truncate_mod(x, y)
|
||||
>>> print(output)
|
||||
[ 2 1 -1]
|
||||
"""
|
||||
return truncate_mod_(x, y)
|
||||
|
||||
|
||||
def trunc(x):
|
||||
def trunc(input_x):
|
||||
r"""
|
||||
Returns a new tensor with the truncated integer values of the elements of input.
|
||||
|
||||
|
|
Loading…
Reference in New Issue