Overloads multiplication operator for a tensor and a scalar of type real64.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(torch_tensor), | intent(in) | :: | tensor | |||
real(kind=real64), | intent(in) | :: | scalar |
function torch_tensor_postmultiply_real64(tensor, scalar) result(output) use, intrinsic :: iso_c_binding, only : c_loc use, intrinsic :: iso_fortran_env, only : real64 type(torch_tensor), intent(in) :: tensor real(real64), intent(in) :: scalar type(torch_tensor) :: wrk, output ! Create a tensor with a single entry, the scalar post-multiplier call torch_tensor_from_array(wrk, [scalar], [1], tensor%get_device_type(), & tensor%get_device_index()) output%p = torch_tensor_multiply_c(tensor%p, wrk%p) end function torch_tensor_postmultiply_real64