Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Relax Tensor initializer generic requirements. #1061

Merged
merged 1 commit into from
Aug 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sources/TensorFlow/Core/Tensor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ extension Tensor {

/// Creates a 1D tensor from scalars.
@inlinable
public init<C: RandomAccessCollection>(
public init<C: Collection>(
_ vector: C, on device: Device = .default
) where C.Element == Scalar {
#if USING_X10_BACKEND
Expand Down Expand Up @@ -384,7 +384,7 @@ extension Tensor {
/// - shape: The shape of the tensor.
/// - scalars: The scalar contents of the tensor.
/// - Precondition: The product of the dimensions of the shape must equal the number of scalars.
public init<C: RandomAccessCollection>(
public init<C: Collection>(
shape: TensorShape, scalars: C, on device: Device = .default
) where C.Element == Scalar {
precondition(
Expand Down