You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

llama.abstractions.tensorsplitscollection.md 2.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # TensorSplitsCollection
  2. Namespace: LLama.Abstractions
  3. A fixed size array to set the tensor splits across multiple GPUs
  4. ```csharp
  5. public sealed class TensorSplitsCollection : System.Collections.Generic.IEnumerable`1[[System.Single, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Collections.IEnumerable
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [TensorSplitsCollection](./llama.abstractions.tensorsplitscollection.md)<br>
  8. Implements [IEnumerable&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1), [IEnumerable](https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable)
  9. ## Properties
  10. ### **Length**
  11. The size of this array
  12. ```csharp
  13. public int Length { get; }
  14. ```
  15. #### Property Value
  16. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  17. ### **Item**
  18. ```csharp
  19. public float Item { get; set; }
  20. ```
  21. #### Property Value
  22. [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  23. ## Constructors
  24. ### **TensorSplitsCollection(Single[])**
  25. Create a new tensor splits collection, copying the given values
  26. ```csharp
  27. public TensorSplitsCollection(Single[] splits)
  28. ```
  29. #### Parameters
  30. `splits` [Single[]](https://docs.microsoft.com/en-us/dotnet/api/system.single)<br>
  31. #### Exceptions
  32. [ArgumentException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentexception)<br>
  33. ### **TensorSplitsCollection()**
  34. Create a new tensor splits collection with all values initialised to the default
  35. ```csharp
  36. public TensorSplitsCollection()
  37. ```
  38. ## Methods
  39. ### **Clear()**
  40. Set all values to zero
  41. ```csharp
  42. public void Clear()
  43. ```
  44. ### **Pin()**
  45. ```csharp
  46. internal MemoryHandle Pin()
  47. ```
  48. #### Returns
  49. [MemoryHandle](https://docs.microsoft.com/en-us/dotnet/api/system.buffers.memoryhandle)<br>
  50. ### **GetEnumerator()**
  51. ```csharp
  52. public IEnumerator<float> GetEnumerator()
  53. ```
  54. #### Returns
  55. [IEnumerator&lt;Single&gt;](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerator-1)<br>