Skip to contents

Function converts a tensor into a numpy array in order to allow further operations in R.

Usage

tensor_to_numpy(object)

Arguments

object

Object of any class.

Value

In the case the object is of class torch.Tensor it returns a numpy error. If the tensor requires a gradient and/or is on gpu it is detached and converted. If the object is not of class torch.Tensor the original object is returned.