Skip to content

Conversation

@gongchensu
Copy link
Collaborator

@gongchensu gongchensu commented Nov 3, 2025

  1. 增加mul算子Python层的接口,添加测试
    测试框架更新后重新修改,测试通过:
image image

import numpy as np


def _scalar_to_tensor(scalar_value, reference_tensor):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

torch是这么做的?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我让他,先看看怎么实现这个功能

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

先去掉了这部分的支持,re-force push了

"""Convert a scalar value to a tensor with the same shape and dtype as reference_tensor"""
# Use torch to create the tensor first (handles dtype conversion correctly),
# then convert to infinicore tensor via from_blob
import torch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

依赖torch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,我先去掉这部分scalar的支持

@gongchensu gongchensu force-pushed the feature/add_mul_python_api branch 2 times, most recently from 222b774 to 5c89a40 Compare November 5, 2025 07:14
@gongchensu gongchensu force-pushed the feature/add_mul_python_api branch from 5c89a40 to a565b36 Compare November 12, 2025 07:48
@PanZezhong1725 PanZezhong1725 merged commit 2286cf7 into InfiniTensor:main Nov 12, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEV] mul算子增加Python层接口

3 participants