TensorPrimitives.Clamp Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Clamp<T>(T, T, ReadOnlySpan<T>, Span<T>) |
Computes the element-wise result of clamping |
Clamp<T>(T, ReadOnlySpan<T>, ReadOnlySpan<T>, Span<T>) |
Computes the element-wise result of clamping |
Clamp<T>(ReadOnlySpan<T>, T, T, Span<T>) |
Computes the element-wise result of clamping |
Clamp<T>(T, ReadOnlySpan<T>, T, Span<T>) |
Computes the element-wise result of clamping |
Clamp<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, T, Span<T>) |
Computes the element-wise result of clamping |
Clamp<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, Span<T>) |
Computes the element-wise result of clamping |
Clamp<T>(ReadOnlySpan<T>, T, ReadOnlySpan<T>, Span<T>) |
Computes the element-wise result of clamping |
Clamp<T>(T, T, ReadOnlySpan<T>, Span<T>)
- Source:
- TensorPrimitives.Clamp.cs
Computes the element-wise result of clamping x
to within the inclusive range specified
by min
and max
for the specified tensors.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static void Clamp(T x, T min, ReadOnlySpan<T> max, Span<T> destination);
public static void Clamp<T>(T x, T min, ReadOnlySpan<T> max, Span<T> destination) where T : System.Numerics.INumber<T>;
static member Clamp : 'T * 'T * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * Span<'T (requires 'T :> System.Numerics.INumber<'T>)> -> unit (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Sub Clamp(Of T As INumber(Of T)) (x As T, min As T, max As ReadOnlySpan(Of T), destination As Span(Of T))
Type Parameters
- T
Parameters
- x
- T
The tensor of values to clamp, represented as a scalar.
- min
- T
The tensor of inclusive lower bounds, represented as a scalar.
- max
- ReadOnlySpan<T>
The tensor of inclusive upper bounds, represented as a span.
- destination
- Span<T>
The destination tensor, represented as a span.
Exceptions
max
and destination
reference overlapping memory locations and do not begin at the same location.
Remarks
This method effectively computes
.destination
[i] = T.Clamp(x
, min
, max
[i])
Applies to
Clamp<T>(T, ReadOnlySpan<T>, ReadOnlySpan<T>, Span<T>)
- Source:
- TensorPrimitives.Clamp.cs
Computes the element-wise result of clamping x
to within the inclusive range specified
by min
and max
for the specified tensors.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static void Clamp(T x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination);
public static void Clamp<T>(T x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination) where T : System.Numerics.INumber<T>;
static member Clamp : 'T * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * Span<'T (requires 'T :> System.Numerics.INumber<'T>)> -> unit (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Sub Clamp(Of T As INumber(Of T)) (x As T, min As ReadOnlySpan(Of T), max As ReadOnlySpan(Of T), destination As Span(Of T))
Type Parameters
- T
Parameters
- x
- T
The tensor of values to clamp, represented as a scalar.
- min
- ReadOnlySpan<T>
The tensor of inclusive lower bounds, represented as a span.
- max
- ReadOnlySpan<T>
The tensor of inclusive upper bounds, represented as a span.
- destination
- Span<T>
The destination tensor, represented as a span.
Exceptions
max
and destination
reference overlapping memory locations and do not begin at the same location.
Remarks
This method effectively computes
.destination
[i] = T.Clamp(x
, min
[i], max
[i])
Applies to
Clamp<T>(ReadOnlySpan<T>, T, T, Span<T>)
- Source:
- TensorPrimitives.Clamp.cs
Computes the element-wise result of clamping x
to within the inclusive range specified
by min
and max
for the specified tensors.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static void Clamp(ReadOnlySpan<T> x, T min, T max, Span<T> destination);
public static void Clamp<T>(ReadOnlySpan<T> x, T min, T max, Span<T> destination) where T : System.Numerics.INumber<T>;
static member Clamp : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * 'T * 'T * Span<'T (requires 'T :> System.Numerics.INumber<'T>)> -> unit (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Sub Clamp(Of T As INumber(Of T)) (x As ReadOnlySpan(Of T), min As T, max As T, destination As Span(Of T))
Type Parameters
- T
Parameters
The tensor of values to clamp, represented as a span.
- min
- T
The tensor of inclusive lower bounds, represented as a scalar.
- max
- T
The tensor of inclusive upper bounds, represented as a scalar.
- destination
- Span<T>
The destination tensor, represented as a span.
Exceptions
x
and destination
reference overlapping memory locations and do not begin at the same location.
Remarks
This method effectively computes
.destination
[i] = T.Clamp(x
[i], min
, max
)
Applies to
Clamp<T>(T, ReadOnlySpan<T>, T, Span<T>)
- Source:
- TensorPrimitives.Clamp.cs
Computes the element-wise result of clamping x
to within the inclusive range specified
by min
and max
for the specified tensors.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static void Clamp(T x, ReadOnlySpan<T> min, T max, Span<T> destination);
public static void Clamp<T>(T x, ReadOnlySpan<T> min, T max, Span<T> destination) where T : System.Numerics.INumber<T>;
static member Clamp : 'T * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * 'T * Span<'T (requires 'T :> System.Numerics.INumber<'T>)> -> unit (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Sub Clamp(Of T As INumber(Of T)) (x As T, min As ReadOnlySpan(Of T), max As T, destination As Span(Of T))
Type Parameters
- T
Parameters
- x
- T
The tensor of values to clamp, represented as a scalar.
- min
- ReadOnlySpan<T>
The tensor of inclusive lower bounds, represented as a span.
- max
- T
The tensor of inclusive upper bounds, represented as a scalar.
- destination
- Span<T>
The destination tensor, represented as a span.
Exceptions
min
and destination
reference overlapping memory locations and do not begin at the same location.
Remarks
This method effectively computes
.destination
[i] = T.Clamp(x
, min
[i], max
)
Applies to
Clamp<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, T, Span<T>)
- Source:
- TensorPrimitives.Clamp.cs
Computes the element-wise result of clamping x
to within the inclusive range specified
by min
and max
for the specified tensors.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static void Clamp(ReadOnlySpan<T> x, ReadOnlySpan<T> min, T max, Span<T> destination);
public static void Clamp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> min, T max, Span<T> destination) where T : System.Numerics.INumber<T>;
static member Clamp : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * 'T * Span<'T (requires 'T :> System.Numerics.INumber<'T>)> -> unit (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Sub Clamp(Of T As INumber(Of T)) (x As ReadOnlySpan(Of T), min As ReadOnlySpan(Of T), max As T, destination As Span(Of T))
Type Parameters
- T
Parameters
The tensor of values to clamp, represented as a span.
- min
- ReadOnlySpan<T>
The tensor of inclusive lower bounds, represented as a span.
- max
- T
The tensor of inclusive upper bounds, represented as a scalar.
- destination
- Span<T>
The destination tensor, represented as a span.
Exceptions
min
and destination
reference overlapping memory locations and do not begin at the same location.
Remarks
This method effectively computes
.destination
[i] = T.Clamp(x
[i], min
[i], max
)
Applies to
Clamp<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, ReadOnlySpan<T>, Span<T>)
- Source:
- TensorPrimitives.Clamp.cs
Computes the element-wise result of clamping x
to within the inclusive range specified
by min
and max
for the specified tensors.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static void Clamp(ReadOnlySpan<T> x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination);
public static void Clamp<T>(ReadOnlySpan<T> x, ReadOnlySpan<T> min, ReadOnlySpan<T> max, Span<T> destination) where T : System.Numerics.INumber<T>;
static member Clamp : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * Span<'T (requires 'T :> System.Numerics.INumber<'T>)> -> unit (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Sub Clamp(Of T As INumber(Of T)) (x As ReadOnlySpan(Of T), min As ReadOnlySpan(Of T), max As ReadOnlySpan(Of T), destination As Span(Of T))
Type Parameters
- T
Parameters
The tensor of values to clamp, represented as a span.
- min
- ReadOnlySpan<T>
The tensor of inclusive lower bounds, represented as a span.
- max
- ReadOnlySpan<T>
The tensor of inclusive upper bounds, represented as a span.
- destination
- Span<T>
The destination tensor, represented as a span.
Exceptions
max
and destination
reference overlapping memory locations and do not begin at the same location.
Remarks
This method effectively computes
.destination
[i] = T.Clamp(x
[i], min
[i], max
[i])
Applies to
Clamp<T>(ReadOnlySpan<T>, T, ReadOnlySpan<T>, Span<T>)
- Source:
- TensorPrimitives.Clamp.cs
Computes the element-wise result of clamping x
to within the inclusive range specified
by min
and max
for the specified tensors.
public:
generic <typename T>
where T : System::Numerics::INumber<T> static void Clamp(ReadOnlySpan<T> x, T min, ReadOnlySpan<T> max, Span<T> destination);
public static void Clamp<T>(ReadOnlySpan<T> x, T min, ReadOnlySpan<T> max, Span<T> destination) where T : System.Numerics.INumber<T>;
static member Clamp : ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * 'T * ReadOnlySpan<'T (requires 'T :> System.Numerics.INumber<'T>)> * Span<'T (requires 'T :> System.Numerics.INumber<'T>)> -> unit (requires 'T :> System.Numerics.INumber<'T>)
Public Shared Sub Clamp(Of T As INumber(Of T)) (x As ReadOnlySpan(Of T), min As T, max As ReadOnlySpan(Of T), destination As Span(Of T))
Type Parameters
- T
Parameters
The tensor of values to clamp, represented as a span.
- min
- T
The tensor of inclusive lower bounds, represented as a scalar.
- max
- ReadOnlySpan<T>
The tensor of inclusive upper bounds, represented as a span.
- destination
- Span<T>
The destination tensor, represented as a span.
Exceptions
max
and destination
reference overlapping memory locations and do not begin at the same location.
Remarks
This method effectively computes
.destination
[i] = T.Clamp(x
[i], min
, max
[i])