What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind bug
/kind task
/kind feature

What does this PR do / why do we need it:
The occasional core dump comes from the bounding box having shape with dimension of 0. This PR fixes the output of ut tests.

Related:
https://gitee.com/mind_spore/dashboard/milestones/31161?issue_id=I391DW
The problem with the above ticket is that the tensor needs to be checked for have data
before being called to be written by the helper function.
Which issue(s) this PR fixes:

Fixes #I3C2YZ:Fixing core dump for random BBoxCrop

Special notes for your reviewers: