The invention discloses a
tensor extension calculation method and device based on TPU, a medium and a product, and relates to the technical field of chips, and the method comprises the steps: analyzing a
tensor extension request, and obtaining the first dimension information of an original
tensor and the second dimension information of a target tensor; determining a tensor expansion demand according to the first dimension information and the second dimension information; according to the tensor expansion requirement, data, needing to be subjected to dimension expansion, in the original tensor is carried to a
control memory or a vector memory from a high-bandwidth memory of the TPU, and in combination with a tensor
broadcasting mechanism on the TPU, target tensor data is formed and stored in the high-bandwidth memory again through
parallel processing of all the core computing units. According to the technical scheme of the embodiment of the invention, a tensor extension
algorithm capable of accurately adapting to TPU hardware features is provided, so that the TPU native supports the extension calculation of the tensor dimension, the blank of the TPU function is filled, and the calculation parallelism and the transmission efficiency in the tensor extension calculation are improved.