Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: broadcast_add #236

Merged
merged 9 commits into from
May 18, 2024
Merged

add: broadcast_add #236

merged 9 commits into from
May 18, 2024

Conversation

yuanhenglee
Copy link
Collaborator

No description provided.

import pyuTensor
import numpy as np

pyuTensor.set_ram_total(100*1024)
Copy link
Member

Choose a reason for hiding this comment

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

No need to allocate ram and meta memory.
We are not using any tensor in uTensor for this test.

pyuTensor.set_meta_total(100*1024)

for shape_a, shape_b in random_broadcastable_shapes:
a = np.arange(np.prod(shape_a)).reshape(shape_a).astype(np.float32)
Copy link
Member

Choose a reason for hiding this comment

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

a and b are not used, please remove them.

bc = pyuTensor.Broadcaster(shape_a, shape_b)
uT_1 = bc.get_shape_c()
np_1 = np.broadcast_shapes(shape_a, shape_b)
assert isinstance(uT_1, tuple)
Copy link
Member

Choose a reason for hiding this comment

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

no need to check the type here.

@dboyliao dboyliao merged commit 58de5ad into uTensor:malloc-allocator May 18, 2024
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants