Skip to content

Tensorflow.Numpy.NDArray constructor abnormal?  #884

Closed

Description

@cross-hello

Here are my code:

 static void Main(string[] args)
        {
            List<int> a =new List<int>{1,-1,-2,-3};
            Tensorflow.NumPy.NDArray aa=new Tensorflow.NumPy.NDArray(a.ToArray());// Point A
            Console.WriteLine("Hello World!");
            Console.Write("Hi");
        }

Point A will raise a error like this:
image

But if I use Tensorflow.NumPy.NDArray aa= (Tensorflow.NumPy.NDArray)a.ToArray(); in the position of Point A, the question solved.
Now I want to know if it is some of my error or others cause it happen.

Activity

  1. Oceania2018 commented on Nov 29, 2021

    @Oceania2018
    Member

    @cross-hello Can you try this sample?

  2. cross-hello commented on Nov 30, 2021

    @cross-hello
    Author

    OK
    I try:

    var x = Tensorflow.NumPy.np.array(1, 2, 3);
    Tensorflow.NumPy.NDArray aa=new Tensorflow.NumPy.NDArray( x.ToArray<int>());

    The code pass. Could you figure me why it happen?

  3. Oceania2018 commented on Dec 5, 2021

    @Oceania2018
    Member

    Fixed for next release.

  4. cross-hello commented on Dec 6, 2021

    @cross-hello
    Author

    Thank you~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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