Skip to content

tensor$repeat(c(...)) not working? #1288

Open
@AlexLeeR

Description

@AlexLeeR

Hi there,

I would like to repeat tensor along the first dimension 4 times.

First I create the tensor
x <- torch_tensor(c(1, 2, 3))

Then I add a dimension at position 1:
x2 = x$unsqueeze(1)

Here I'm attempting to repeat the first dimension four times and it throws an error:

>repeated_matrix <- x$repeat(c(2, 1))
Error: unexpected 'repeat' in "repeated_matrix <- x$repeat"

I also tried different variations:

> repeated_matrix <- x$repeat(list(2, 1))
Error: unexpected 'repeat' in "repeated_matrix <- x$repeat"
> repeated_matrix <- x$repeat(dim=c(2, 1))
Error: unexpected 'repeat' in "repeated_matrix <- x$repeat"
> repeated_matrix <- x$repeat(dims=c(2, 1))
Error: unexpected 'repeat' in "repeated_matrix <- x$repeat"

All of which are not working!

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions