mindspore.Tensor.expand_as ========================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/mindspore/Tensor/mindspore.Tensor.expand_as.rst :alt: 查看源文件 .. py:method:: mindspore.Tensor.expand_as(x) 将目标张量的维度扩展为输入张量的维度。 参数: - **x** (Tensor) - 输入的张量。 返回: 维度与输入张量的相同的Tensor。输出张量的维度必须遵守广播规则。广播规则指输出张量的维度需要扩展为输入张量的维度,如果目标张量的维度大于输入张量的维度,则不满足广播规则。